🎯 Learning Objectives
After this lesson you should be able to:
- Produce your first complete games
Last lesson, you…
- Discussed graphics and sprites in games
- Learned about User Experience
- Developed your first programs using graphics.
Today, you will…
- Develop your first complete games that use all the skills covered so far
🎮 Starter Activity
Play the following three games. What do you notice?
Game 1:
Game 2:
Game 3:
Click here for the answer
These are all the same game, at least in terms of their code. They use different assets to create varying user experiences, but they all work in exactly the same way.
📝 Activity – Your move, punk!
Today you’re going to develop a game like these yourself. You can use any of the existing assets, or you can import your own.
The starting code can be found on Replit.com here. You will need to create an account and fork the game to be able to change it.
You need to go back and apply everything you have learned so far to complete the following tasks:
- Get a background created and drawn onto the screen – this code is started for you
- Get player and target sprites drawn onto the screen – use the background code and previous lessons to help you
- Get the player sprite to follow the mouse bug free – you’ll need to refer back to last week’s code for this!
- Get collision detection working so that when you click the target with the player, it moves to a new position.
- Add in any extra features you think will improve the game – e.g. sounds, a score counter, a timer, a menu. You will need to do some independent research for this.
💬 Summary
Today, you …
- Built your first game!
In the next lesson, you will…
- Develop a second game and look to improve it.
🏅 Badge it
🥈 Silver Badge
- A simple game with sprites that move.
🥇 Gold Badge
- A game where the collisions work properly and the target sprite updates.
🥉 Platinum Badge
- A game with more refined features, such as a score count, a timer, sound effects, or even a menu system.