🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·
🎮 Game Design

Enemies — Spawning & Moving Foes

Enemies make games challenging! They can be stored in an array. Each enemy has a position and moves every frame. When the player collides with one, the player loses a life. When an enemy goes off-screen, remove it and maybe spawn a new one.

3 min 10 XP Lesson 6 of 9
Enemies — Spawning & Moving Foes

Enemies make games challenging! They can be stored in an array. Each enemy has a position and moves every frame. When the player collides with one, the player loses a life. When an enemy goes off-screen, remove it and maybe spawn a new one.

Quick Quiz

1 / 2

Why store enemies in an array?