160 likes | 663 Views
Pinball. A game to understand and finish. Pinball. What happens: A pinball gets bounced around in a fantasy world. INSTRUCTIONS Click the Green Flag to start. Press the Left/Right arrows to control the flippers. HOW IT’S MADE
E N D
Pinball A game to understand and finish
Pinball What happens: A pinball gets bounced around in a fantasy world. • INSTRUCTIONS • Click the Green Flag to start. • Press the Left/Right arrows to control the flippers. • HOW IT’S MADE • Any time the pinball touches anything green it bounces off. • When it touches orange it slides down. • When it touches red it bounces way up. • The pinball's "gravity" works by always turning towards the down direction while always moving forward.
Objective • To complete a Pinball game using BYOB . • The game has been started for you on the compsci drive in the Designing Tech folder.
Directions • Start BYOB • Open the Pinball_YourNamefile from the Compsci drive in the Designing Tech folder. • Save it to your H: drive with your own name.
Some information: the pinball • The code for the pinball makes it move and bounce • Right now, the program doesn’t keep score. If the pinball touches something green It turns the opposite direction(direction – 180) Plus a random amount from -50 to +50 This makes it bounce around in a random way. If the pinball touches a red paddle It makes a noise It goes faster (normal speed is 6) It reverses direction (from 150 to 210 degrees away from its original direction) and gravity goes away for a moment of time.
The bumpers • Each bumper reacts when the pinball touches it • It uses special effects to look like it’s reacting • This is where you should add in thecode to score points.
The paddles • This is a clever trick • The left paddle starts out facing direction 155(Note: 0 is straight up so 155 is like this) • When the left arrow is pressed it turns counter-clockwise like this: • When it’s at 90 degrees, it stops turning(90-90)/4 = 0 degrees of turn
Try the program • Click the green flag to start the game • Press the left and right arrow keys to move the paddles • Once the ball hits the purple line at the bottom of the stage the game is over.
Answer questions on Edline • Use BYOB and the Rock Paper Scissors program to answer the questions. • If you can’t get into your Edline account, ask the sub for a paper to write your answers on.
Finish the program (show directions) Make the directions show up • When the Green flag is pressed: • Make the pinball wait 2 seconds before starting • Make the “How To” sprite show up for 2 seconds and then hide Fix this part
Finish the program (keep score) • Create a variable called points • Check the box to make the points variable show up on the stage. • Any time the pinball touches a triangle, add 1 point • Any time the pinball touches the Star, monster or dino, add 2 points • Any time the pinball touches the musiball, add 3 points. Change points by 1, 2 or 3 in the code for each sprite as shown above
When it’s finished • The instructions should show up at the beginning • The Points should be displayed