Halloween Game

Here we have a girl moving through the forest. The objective is to reach the golden key by escaping the obstacles.ie. a zombie and a bat by pressing the arrow keys. If the girl touches any of the obstacles, she changes colour and a new backdrop appears which says “You Lose”. If the girl reaches the key, there is a fairy dust sound and a new backdrop appears saying “You Win”.

  1. Coding the Sprites

2. Coding the Backdrops

Halloween Game (Coding The Backdrops)

Backdrops –

  1. Instructions
  2. Where we play
  3. You Lose
  4. You Win

Steps –

  1. Click on the Backdrop under where it says stage.
  2. Go to the events tab and drag “when the green flag is clicked” to the code window.
  3. Go to the looks tab and connect “switch backdrop to woods” to the code. Go to the control tab and connect “wait 3 secs” to it.
  4. Go to the looks tab and connect “switch backdrop to woods 2” to the code. Go to the control tab and connect the forever loop.
  5. Go to the sound tab and put “play sound cave” inside the forever loop.
  6. Go to the control tab and connect “wait 8 secs” to the previous code
  7. Go to the events tab and drag “when I receive lose” to the code area. Go to the control tab and connect “wait 0.5 sec” to it. Go to the looks tab and connect “Switch backdrop to woods 3”to it. Go to the control tab and connect “stop all” to it.
  8. Go to the events tab and drag “when I receive win” to the code area. Go to the control tab and connect “wait 0.5 sec” to it. Go to the looks tab and connect “Switch backdrop to win backdrop” to it. Go to the control tab and connect “stop all” to it.

9. I Just remembered we have to connect wait 3 sec before the zombie and the bats start their movement so that they don’t move when instructions are being displayed.

a) Zombie- Add “wait 3 sec” before forever loop.

b) Bat1- Add “wait 3 sec” before forever loop.

c) Bat2- As we had already added “wait 2 sec” previously so we are going to change it to “wait 5 secs”.

10. Congratulations! Your game is complete. Enjoy playing it and if you find any error try to rectify it.

Halloween Game (Coding the Sprites)

SPRITES –

  1. Zombie- It moves up and down continuously and says “Brains”.
  2. 2 Bats- They move in a zig-zag movement up and straight movement down.
  3. Girl- It moves back and fourth.
    • It moves back and fourth.
    • It reacts to loosing by changing colour and screaming.
    • It reacts to winning by a fairy dust sound.
  4. Key

STEPS –

  1. Open scratch and click on create.
  2. Change the name from where it says untitled to Halloween Game.

3. Go to add backdrop and choose the woods backdrop and do the same three more times.

4. You can see all the backdrops in the backdrop tab.

5. Choose the first woods backdrop in which we have to put instructions to play.

6. Click on the text button [T].

7. Choose a colour of text from the fill button.

8. Type the instructions you want to add.

9. Choose the third wood background in which we lost.

10. Change the font and type “to lose” in the left corner.

11. Choose the backdrop 1 which is a blank white screen.

12. Now you can customize it yourself by either putting colourful dots and shapes or by downloading and backdrop from internet and uploading it.

13. Type the text “You win”.

14. Select the second wood backdrop. Delete the cat sprite. Add a bat sprite and make them small also upload the zombie sprite.

15. Add the girl walking sprite and the key sprite and reduce their sizes also.

16. Click on the key sprite, go to the motion tab and click on turn 15 degrees until it is vertical.

17. Arrange all the sprites to their desired positions.

18. Click on the Zombie sprite.

19. Go to the events tab and drag “when green flag is clicked” to the coding screen.

20. Go to the motion tab and connect “go to x= and y=” to the previous code.

21. Move the zombie to the top of the screen. Go to the motion tab and connect “Glide 2 secs to x= and y=” to code.

22. Move zombie back to original position and Go to the motion tab and connect “Glide 2 secs to x= and y=” to code.

23. Go to the sound tab and select “play sound” and record yourself saying brains and then choose it from the small arrow.

24. Put a forever Code around glide and sound.

25. Click on the bat and go to the events tab and drag “when the green flag is clicked to the code window.

26. Go to the motion tab and select “Go to x= and y=” and they will show the initial values of the bat.ie. x=72 and y=(-116).Connect it to previous code.

27. Move the bat diagonally towards the right side and then go to the motion tab and connect “glide 1 sec to x=123 and y=(-36)” to the previous code.

28. Move the bat diagonally towards the left side and then go to the motion tab and connect “glide 1 sec to x=19 and y=68” to the previous code.

29. Move the bat diagonally towards the right side and then go to the motion tab and connect “glide 1 sec to x=132 and y=150” to the previous code.

30. Move the bat diagonally towards the left side and then go to the motion tab and connect “glide 1 sec to x=72 and y=(-116)” to the previous code.

31. Go to the control tab and drag forever loop to the code screen. Put all the Glide statements inside the forever loop.

32. Now as we wanted two bat sprites so we will right click on the bat 1 sprite and click on duplicate.

33. Now bat 2 sprite has the same code as bat 1 sprite. So they will move together but we want them to have different movements. So, we will click on the bat 2 sprite and go to the control tab and connect “wait 2 sec” above the forever loop.

Here is the Code of BAT 1
Here is the code of BAT 2

34. Click on the girl and go to the events tab and drag “when the green flag is clicked” to the code screen.

35. Go to the motion tab and connect “go to x=(-171) and y=(-72)” to the previous code.

36. Go to the control tab and select if then statement. Go to the sensing tab and put “touching” between if and then.

37. Go to the sound tab and put “play sound” in the then statement. Go to the looks tab and connect “change colour effect by 50” to it. Also go to the events tab and connect “Broadcast message” in the then statement”.

38. Change the message to “lose”. Right click on this if then statement and click duplicate. Do this two more time. Join all the if then statements.

39.  Now in the key touching statement change the sound to “fairy dust”, Delete the change colour statement by right clicking and let it broadcast a new message “Win”.

Here is the code for the girl till now

40. Now we have to distinguish the girl motion.ie. right and left. Go to the events tab and Drag “when the right arrow key pressed” to the code window.

41. Go to the motion tab and connect “change by 20” to the previous code. Go to the events tab and Drag “when the left arrow key pressed” to the code window.

42. Go to the motion tab and connect “change by -20” to the previous code.

Code For Movement of girl

43. Go to the Control tab and put the forever loop around all the if statements.

Code After adding forever loop

44. Our code for the girl sprite is complete.

45. Save your progress till now.

Zombie Farm

This is a very simple game in which you have to use arrow keys to make the zombie reach the girl and she screams and runs away. Aahhhh…

STEPS –

  1. Open scratch and click on create.
  2. Change the name from where it says untitled to Zombie Farm.

3. Choose a Backdrop by clicking on backdrop icon.

4. Here you can select from a wide range of backdrops.

5. Select farm backdrop.

6. Right Click on the cat sprite and choose delete.

7. Click on choose a sprite from library.

8. Insert a girl and the zombie sprite.

9. Shrink them by clicking on the shrink button.

10. Move the sprites to the desired places.

11. Click on the Zombie sprite.

12. Go to events tab and select “When the green flag is clicked” and drag it to the code window.

13. Go to motion tab and select “Go to x= y=” and join it with previous code.

14. Go to event tab and drag 4 “When space key is pressed” to the code window.

15. Select up, down, right and left in each of them by clicking on the small arrow button.

16. Go to the motion tab and select change x by 10 and drag two of them and attack them with the right and left arrow commands. In the left arrow key change it to (-10).

17. Go to the motion tab and select change y by 10 and drag two of them and attack them with the up and down arrow commands. In the down arrow key change it to (-10).

18. Click on the girl. Go to the events tab and select when the green flag is clicked.

19. Go to motion tab and select “Go to x= y=” and join it with previous code.

20. Go to the control tab and select “if and then command” and drag it to the coding area.

21. Go to sensing tab and select “touching” and write zombie in it and put it between if and then.

22. Go to the looks tab and select “say hello!” and change it to “say AAHH!!”.

23. Go to the sound tab and select pay sound and add a female screaming sound from the down arrow.

24. Go to the motion tab and select “glide 1 sec to x= and y=”.

25. Go to the control tab and select the forever command and put it around the if then statement.

26. Now we join it to the go to statement.

27. Save the file now.

28. Our first game is ready…

Hocus Pocus!!

In this story a wizard girl is walking on a path to the castle and a monkey is hiding in the forest. The wizard casts Hocus Pocus and the monkey appears in front of the wizard. There is also a magic spell sound.

  1. Open scratch and click on create.
  2. Change the name from where it says untitled to Wizard Boy story.

3. Choose a Backdrop by clicking on backdrop icon.

4. Here you can select from a wide range of backdrops.

5. Select castle backdrop with a path in it.

6. Right Click on the cat sprite and choose delete.

7. Click on choose a sprite from library.

8. Insert the Wizard Boy and the monkey sprite.

9. Shrink them by clicking on the shrink button.

10. We can Change the wizards colour by going to costume tab.

11. Move the sprites to the desired places.

12. Click on Wizard Girl.

13. Go to events tab and select “When the green flag is clicked” and drag it to the code window.

14. Go to motion tab and select “Go to x= y=” and join it with previous code.

15. Move the Boy to the middle of the path.

16. Select “Glide 2 sec x= y= “ and join it too.

17. The values of x and y will be with respect to its new coordinates in the middle of the path.

18. You can view these coordinates here.

19. As Hocus Pocus is the signal for monkey to appear. So, we go to events and connect “broadcast message”.

20. Change Hello to “Hocus Pocus”.

21. Go to looks tab and select “Say Hello for 2 secs” and connect it too.

22. Go to sound tab and choose “play a sound” and connect it.

23. Go back to Code and Click arrow and select Magic Spell.

24. Click on the monkey sprite.

25. Go to the event tab and select “when the green flag clicked” and place in code area.

26. Go to motion tab and select “go to x= and y= “ and connect it.

27. Go to event tab and select “when I receive Hocus Pocus” and connect it.

28. Go to motion tab and select “go to x= and y= “ and connect it.

29. Go to file and save.

30. Our story is complete…

Cat in The Desert

This is a very basic story to begin with scratch programming. In this story a cat is standing in the Desert. Cat walks some steps and says Meow!

STEPS –

  1. Open scratch and click on create.
  2. Change the name from where it says untitled to “Cat in The Desert”

3.Choose a Backdrop by clicking on backdrop icon.

4. Here you can select from a wide range of backdrops. Select desert backdrop

5. Move the sprite to the desired places.

6. Go to Events and select “When the green flag is clicked” and move it to Code Window.

7. Go to Motion and drag “move 10 steps” and join it under the previous command.

8. Change 10 steps to 200 steps.

9. Go to looks and drag “say Hello!” and join it too.

10. Change “Say Hello!” to “Say Meow!!”

11. Go to File and click “Save Now”

12. Your First Game is ready enjoy playing…