1 / 18

Creating a Scratch Packman

Creating a Scratch Packman. What you will learn:. To design a maze background To resize a sprite To move a sprite under keyboard control Stop the sprite moving over the background To get ‘prizes’ to disappear To score with the prizes To get the prize to appear again unexpectedly

dylan
Download Presentation

Creating a Scratch Packman

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. Creating a Scratch Packman

  2. What you will learn: • To design a maze background • To resize a sprite • To move a sprite under keyboard control • Stop the sprite moving over the background • To get ‘prizes’ to disappear • To score with the prizes • To get the prize to appear again unexpectedly • To choose your own prizes • To randomly alter the grid.

  3. Stage 1 of Packman Maze Score ‘Prize’ Explorer

  4. Stage 2 of Packman Explorer moves

  5. Stage 3 of Packman Score goes up Explorer grabs prize

  6. Stage 4 of Packman Explorer moves on

  7. Stage 5 of Packman ‘Prize’ reappears

  8. What you need to decide • To decide on a maze background grid. • To decide on the sprite as the explorer. • To plan the ‘prizes’ – the sprites and the points for each. • To plan for how long a prize would disappear. • To decide if the background will change to a new level or will the grid alter randomly.

  9. Design a background • The background must have one colour that the sprite cannot cross (blue in the example.) • The passage ways must be broad enough to take the sprite.

  10. Replace the Cat • Delete the cat sprite. • Choose a new sprite – use the central button under the stage. I called it the explorer. • Resize the sprite to make it small enough to follow the passages. Step 1 Step 2 Step 3

  11. Get the Sprite to Move • Use the starting code as below – make sure all directions work.

  12. Keep the Sprite on Track • Stop the sprite moving over the background by … • … checking if it has moved too far. • If so, move back 5

  13. Add a “Prize” • Add a “prize” – a banana. • Place it in a passageway. • There should be a forever loop • The script should hide the banana if it is touching the explorer. • Remember to save your Scratch program.

  14. Score Grabbing a Prize • There are 2 parts • A variable to store the score • The score needs to increase when the prize is grabbed.

  15. Restore the Prize • The banana needs to reappear and at a random time makes a difference. • Use the pick random 1 to 10from Numbers • Put it inside a wait. • Decide on the longestand shortest waits • Remember to save your Scratch program.

  16. Introduce another Prize • Introduce other sprites as prizes. • Resize and add the correct script to each. • Choose where each is to go, what effect it will have on the score, how quickly each should reappear. • Remember to save your Scratch program.

  17. Make your code efficient • The script to stop the sprite going onto the grid might be more efficient. • Do you have this section only once? • Are there any other parts to be improved?

  18. Further ideas • Does the score set to zero for each game? • Is there a time limit or a target score? • Further sprites could be added to block/unblock sections of the grid. • This could make the game change as it is played. • There could be different levels with the background changing after a time. • There could be tunnels which move the player to a new maze background …

More Related