Make the sprite move, shoot and jump
Your challenge is to add controls as well as shooting to this game template
challenge.zip | |
File Size: | 93 kb |
File Type: | zip |
Tasks
1. Use code that you have previously worked on to make the sprite move left, right and jump
2. Add code that makes the sprite shoot when the space bar is pressed
Tips:
2. Add code that makes the sprite shoot when the space bar is pressed
Tips:
- The bullet could just be a rectangle or circle sprite
- Remember to stop drawing the bullet once it leaves the edge of the screen
- The sprite will not always start in the same place and can move - you will need to calculate where to draw the bullet
Further Tasks
Add an enemy sprite and see if you can detect when the bullet hits it!
You can even create your own characters on this website (Note: gifs do not work in Pygame): http://www.piskelapp.com/ |