Sunday, April 24, 2011
Scratch Soccer Game Part 2
Welcome to Part 2 of our Scratch Soccer Game. Click the top right hand corner green flag to start. (Make sure computer sound is on, so you can hear the sound effects).
Then use the keyboard arrow keys on your computer to move side to side and kick the ball. If you miss a ball and it goes through to the yellow line, then you lose, and the game ends.
Use the top right hand corner red stop sign to stop the animation.
Then Click the Green Flag in the top right corner to Play Again.
This post contains the second of a series of tutorials that will result in our final full soccer game.
In this second tutorial we add a Goal Net to our game.
The Soccer Player and ball were obtained for free from Cliker.com. We modified the player in Adobe Fireworks and resized him to around 50x50 pixels in size, then saved him as a transparent GIF file. (When doing this, we had to go into "options" while saving and turn alpha transparency on in Fireworks).
We obtained the Goals from an American Department store online catalogue, and changed their background from white to green using the colour replace painting tool in Adobe Fireworks.
Because the goals contained some white colour, they caused some false "out of bounds" problems, and so we fixed this by changing the game's out of bounds line from white to yellow by editing the background in Scratch.
The following YouTube tutorial shows the steps required to build Part 2 of the Soccer Game that is present at the start of this post.
Note that by adjusting the bottom right hand controls, it can be viewed full screen in HD. (Press Escape to return to this blog page when finished).
Here is the script code for the "Kicker" that allows the arrow keys to be used to move him left and right along the bottom of the screen.
Here is the script code for the Goals that allows them to broadcast a message to the ball whenever a Goal is kicked.
Finally, here are all of the script code blocks for the ball.
We will finalise the development of this Soccer Game in upcoming Tutorials.
Our plans are to create scoring for the Goals, as well as creating lost lives for missed kicks, and track these as well. The game will also issue a "Game Over" message when all lives have been lost.
Keep an eye out for these tutorials in upcoming posts.
Make sure you give our tutorials a go, by downloading and installing the Scratch Development Environment for free on your PC from the following link:
http://info.scratch.mit.edu/Scratch_1.4_Download
We promise you will really enjoy kicking goals with Scratch!
Enjoy,
Big Passy Wasabi
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment