2 PLAYER SOCCER ROOK10 Open a new scratch project. RIGHT CLICK and DELETE SPRITE 1 (the kitty). SOCCER BALL Use the CHOOSE NEW SPRITE FROM FILE button. Find the SOCCER1 SPRITE in the THINGS folder. Use the SHRINK button to bring the SOCCER ball into perspective with the playing field. TYPE to rename the SPRITE “ball”. Use these tiles to get the ball bouncing. If we leave the initial direction at 90 the ball will simply bounce back and forth. Changing the initial direction number to something other than 0, 90, -90, 180, -180 (the x and y axis) creates a more interesting bounce. Try using an odd (not even) number. Give it a try. CLICK the GREEN FLAG. KICK BUTTONS Use the CREATE A NEW SPRITE FROM FILE button. Choose the BUTTON SPRITE out of the THINGS FOLDER. TYPE to name the SPRITE “button 1” CLICK the EDIT button. Use the ROTATE button to change to a vertical. CLICK OK. MOVE the button over to the RIGHT SIDE of the screen. Use these tiles to have the kicker button move up and down. Give it a try. Use the UP and DOWN ARROW buttons to move your kicker. RIGHT CLICK and DUPLICATE this SPRITE TYPE to name this SPRITE “button 2” This button will be controlled by PLAYER 2. This player will use the “a” and “z” keys to move the kicker up and down. Move this button to the LEFT SIDE of the screen. Change these values on the SCRIPT for the button 2 SPRITE. Try both kicker buttons. Does the right kicker work with the arrow keys? The left kicker with the a and z keys? Now is a good time to SAVE your work. BALL BOUNCE WHEN KICKED When the ball contacts one of the kicker buttons we want it to bounce. A bounce is a simple, sudden change of direction. If you are headed one direction, a turn of 180˚ will turn you completely around. For example, if you are headed NORTH you are on a compass heading of 0˚. An immediate turn of 180˚ would result in a course change to due SOUTH. Use these tiles in the SCRIPT for the ball to have it bounce off of the kicker button. Make (or duplicate) a second IF loop for contact with the other kicker button. Now would be a good time to CLICK the GREEN FLAG and give it a try. NOTICE that the ball gets stuck bouncing between the two buttons when an exact turn of 180˚ is used. We need to add a bit of randomness to the kick, something that simulates how a real kick is never exactly the same as one before it. SCRATCH has a handy tile which lets the computer pick a number from a given set. Here we will use this function to add a random value in the range of -20˚ to +20˚ to the direction of the bounce. Add these tiles to the SCRIPT for the ball SPRITE. Use the green addition operation: And the PICK RANDOM tile: The final result should look like this. Here we ADD a RANDOM value of -20 to 20 degrees to our 180 degree turnabout. Now try the game and see if a more interesting play has been achieved. GOAL LINES Use the PAINT NEW SPRITE button to make a new SPRITE. Choose a medium pen size and draw a GREEN vertical line from the top to the bottom of the PAINT EDITOR. CLICK OK. Move this SPRITE 1 all the way to the LEFT edge of the screen. RIGHT CLICK and DUPLICATE this SPRITE. Move SPRITE 2 all the way to the RIGHT edge of the screen. SCORE Create two new VARIABLES. NAME them “PLAYER 1” AND “PLAYER 2”. MAKE SURE to check the “FOR ALL SPRITES” button. Move PLAYER 2 to the TOP RIGHT side of the screen. Insert this SCRIPT for SPRITE 1 (the goal line for player 2) Insert this SCRIPT for SPRITE 2 (the goal line for player 1) MODS There are many ideas for mods for this game. Here are a few. BACKGROUND: Using a drawing of a soccer pitch like this one for your STAGE COSTUME. (you can copy and paste this graphic to paint. Save it as a jpg. Import into SCRATCH.) LIMIT BALL DIRECTION Game play can be enhanced by limiting the direction of the ball, eliminating some of the up and down trajectories. In this example these tiles any ball headed to the right less than 55˚ gets corrected to 55˚. Any ball headed to the left between 0˚ and -55˚ gets reset to -55˚. A similar correction is made for the balls headed 125˚ to 180˚and -125 to -180. VARIABLE BALL SPEED Create a variable for the speed of the ball. This variable could increase (try a decimal value like .3 ) each time the ball is kicked or a goal is scored. GOALIE GRAPHICS Try and find a goalie graphic to replace the button. Remember this is a top view design. GAME OVER GRAPHICS Create new sprites to pop up when a player reaches a certain score. For example:
© Copyright 2026 Paperzz