1 / 24

Marble Racer

Marble Racer. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are stored. The SCRIPT BLOCKS are where the instructions of what your SPRITES can do !.

lorettaf
Download Presentation

Marble Racer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Marble Racer

  2. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are stored. The SCRIPT BLOCKS are where the instructions of what your SPRITES can do! SCRIPTS AREA is where you put your instructions The SPRITES are where you store and select the STAGE and COSTUMES

  3. What is a Sprite? • A Sprite is a character that plays in the game • Students can change their sprite, either by drawing a new one • Or choosing one from a file

  4. Lesson 2 – Marble Racer

  5. Design a racetrack and car • You need to design a simple racetrack and race car as viewed from above. • You will need to keep your design simple so that you can draw it using the paint editor • You will need to use clear colours as these will be used to detect the position of the car.

  6. What will we learn? • Move a sprite using the keyboard. • Add to players to the game • Use the stop script to stop a game • Use the say block to announce a winner • Add a timer to show the winning time

  7. Create a new background with the editor • Click on the stage and use the editor to draw a racetrack

  8. Add a car sprite that you have designed

  9. Use the up arrow key to move the car • Use the forever control block and the if control with the key pressed sensor to detect a key pressed and move the car.

  10. Use the up arrow key to move the car • Use the forever control block and the if control with the key pressed sensor to detect a key pressed and move the car.

  11. Use the other arrow keys to move the car • Test the program to make sure you can move the car in all directions. Change the move steps amount to slow down or speed up the car.

  12. Use the other arrow keys to move the car • Test the program to make sure you can move the car in all directions. Change the move steps amount to slow down or speed up the car.

  13. Add a second car • Use the a, s, w, z, keys to control the second car so you can have a two player game

  14. Test your game • Get into pairs and play each others games to make sure that both cars move correctly in all directions.

  15. Be a winner! • Create a finish line sprite so that when a car touches the finish line they win!

  16. Key Point – Stop Script • Stop script • Use the stop script so that once a car has won the race another car cannot win. Try the game without the stop script.

  17. What else do we need? • Add a timer to see how fast the winning car goes. • Stop the game if a car goes on the grass OR keep a score of the number of times the car goes on the grass • Reset the game once a car has won

  18. Add a timer • Tick the timer on the sensing block to create a timer

  19. Add a timer • Tick the timer on the sensing block to create a timer

  20. Announce the winning time • Use the say block from the Looks controls and the reset timer from the sensing controls to announce the winning time

  21. Announce the winning time • Use the say block from the Looks controls and the reset timer from the sensing controls to announce the winning time

  22. Stop the car if it goes on the grass • Use the if control with the touching colour sensor to detect the car on the grass. Reset the car position when green flag clicked.

  23. What now? • Get into pairs and play your games and see what improvements you can make. • Discuss your games with each other as you test them. • You made to need alter the size and orientation of the cars to get them both to fit on the start line. • You may want to change the value of move to slow the game down if you are crashing all the time.

  24. Extension tasks • Create a timer for each car using variables • Make the car explode when it goes on the grass (hint: switch costumes) • How can you stop a car going backward around the course and crossing the finish line in the wrong direction? • Change the stage at the end of the race to show a new racetrack and start a new game

More Related