🇬🇧 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

Score & Lives — The Reward System

Every game has a scoring system and a way to lose. Track score (goes up) and lives (goes down when you get hit). When lives reach 0, the game ends. Let's build this system with functions.

3 min 10 XP Lesson 4 of 9
Score & Lives — The Reward System

Every game has a scoring system and a way to lose. Track score (goes up) and lives (goes down when you get hit). When lives reach 0, the game ends. Let's build this system with functions.

Quick Quiz

1 / 2

Why check state.gameOver before doing anything?