Download presentation
Presentation is loading. Please wait.
1
Games Programming in Scratch
Shooting and Jumping Games Programming in Scratch
2
Learning Objectives Learn programming techniques to add shooting at a target into a game Learn how to adjust x and y coordinates to control the position of a sprite Learn how to make a sprite jump
3
Shooting You can set this up in a variety of ways:
Shooting with a crosshair following the mouse Shooting (with or without visible ammunition) from a static position, e.g. a first person shooter Shooting whilst moving a character (Platform game)
4
Shooting with a crosshair
Create a crosshair sprite Make it go to the mouse pointer Make another sprite disappear when it gets clicked Add one to the score
5
First Person Shooter Make your weapon follow the mouse
Hide sprites that get shot (or clicked on)
6
Shooting whilst moving
Create a variable to store the direction for the bullet Create a bullet sprite and make the bullet come from your character when a key is pressed
7
Jumping Create a variable to control the jump Set the variable to 0
If you are on the ground… And If you press a key to jump Change the jump variable Change the character’s position on the ‘y’ axis by the jump value Gently bring the character back down by reducing the y coordinate by -1
8
Jumping practise!
9
Finding Ideas How do other games in the Scratch library make use of shooting or jumping? Type ‘shooting’ or ‘jumping’ into the search box and look at the code using the See Inside button Adapt these ideas to fit your own game
10
Comment your Code Add comments to your code to help explain what each part does
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.