Beginners Scratch – Week 7 – Breakout

***Next week we will be doing Animation! Please bring any miniature figures that you might want to use to create a short story through stop motion photography. We will also need some way to take photos and download the images to the computer – so parents need to remember a camera and download cables. I will bring a big load of modelling clay.***

Breakout is a variation of our previous game, Paddleball. We create a new scoring experience for our gamers by introducing blocks at the top of our screen that they get points for hitting.

CDA-S5-Challenge_04-Breakout-game view

Everyone already knew how to import or create the first two sprites – the paddle and the ball and most coders remembered from paddleball how to get the paddle to forever follow the mouse in only the x-direction. CDA-S5-Challenge_04-Breakout-paddle control

The code to move the ball was essentially the same as in the paddle ball game with a small change to broadcast the starting position to itself.CDA-S5-Challenge_04-Breakout-ball control 2

We then created two variables, one for the score which will go up when the ball hits a block sprite(can you copy this code from the Paddleball game code and use it in the ball sprite?) and one for lives which will go down every time the ball touches the end line we added under the paddle on the Backdrop. Can you figure out where to put the code to reduce lives by one when the ball touches a certain colour?CDA-S5-Challenge_04-Breakout-variables

Lastly, we created the block sprites and coded for them to fade away when they touched the ball. We use the EFFECT block of code in LOOKS.CDA-S5-Challenge_04-Breakout-brick script

The complete set of notes in .PDF format can be opened here:CDA-S5-Challenge_08_Breakout. You can play with my completed game on the http://scratch.mit.edu webpage. If you sign in as cdathenry1516 and use the password: cdathenry, you will be able to play all our games. If you have your own sign in name, just search for cdathenry1516 and you can see and play them all as well. Please put yours up there as well!CDA-S5-Challenge_04-Breakout-save to website

See you all next week!

Julie

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s