mBlock Simple Game Instructions - Creating a simple game of lives and points Sprite 1 (The Cat) Make the Panda move back and worth 1. 2. 3. 4. 5. Events ->> When Flag Is Clicked Control -> Forever Motion ->> Move 10 Steps (inside Forever) Motion ->> If On Edge Bounce (inside Forever) Constrain motion: Click on the "I" " beside your M-Panda icon. Then click on the arrow going left-right to constrain rotation to left and right facing only. 6. Looks -> Next Costume (inside Forever) If you want, you can make the Panda bounce at angles by going back to the "I" from Step 5 and locating the circle with a dark line. That line represents represents the direction the Panda calls "front". Just left left-click it and hold the mouse button while rotating it like a clock-hand clock to any direction you want. Try making it point diagonally. Sprite 2 (Player Sprite or Sprite 2) Create a new Sprite to be the Player Controlled Sprite and give it Button Control Pick a new Sprite from the file. 1. Events-> When Space Key Pressed (change Space to Right Arrow) 2. Motion -> Point in Direction 90 (click dropdown to make sure it says (90) Right) 3. Motion -> Move 10 Steps 4. Events -> When Space Key Pressed (change Space to Left Arrow) 5. Motion -> Point in Direction 90 (click dropdown to make sure it says (-90) Left) 6. Motion -> Move 10 Steps 7. Events -> When Space Key Pressed (change Space to Right Arrow) 8. Motion -> Point in Direction 90 (click dropdown to make sure it says (0)Up) 9. Motion -> Move 10 Steps 10. Events -> When Space Key Pressed (change Space to Right Arrow) 11. Motion -> Point in Direction 90 (click dropdown to make sure it says (180) Down) 12. Motion -> Move 10 Steps Make Sprite 2 Lose Lives if it touches m-Panda m 1. Data&Blocks ->> Make a variable a. Call it "Lives" b. Make it for all sprites 2. Events ->> When Flag Clicked 3. Data&Blocks ->> Set Lives to 0 a. Change the 0 to 3 (or whatever lives you want to start with 4. Events ->> When Flag Clicked 5. Control -> Forever If 6. Sensing ->> Touching (change dropdown to Sprite 1). (Put this as the Forever If condition) 7. Data&Blocks ->> change Lives by 0 (change the 0 to -1) 8. Looks ->> say "Hello" for 2 seconds. sec (Change "Hello" to "Ouch!". Change 2 to 1) Stage 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Click on the Backgrounds Tab Change the name of background 1 to START Click on Paint Click on the big T and type "YOU LOSE" in the middle of the screen, then click OK Change the name of background 2 to LOSE Click on the Scripts tab Events ->> When Flag Clicked Looks ->> Switch to background. Make sure the dropdown says "START" Events ->> When Flag Clicked Control -> Forever if Operators ->> (greater than sign). Put this into the condition for the forever if. Variables -> "Lives". Put this into the left side of the greater than sign. Click on the right side box of the greater than sign. Type 1. Looks ->> switch to background. Change the dropdown to "LOSE" Control -> stop all You have now made it so that if the cat touches your player sprite 3 times, you lose and the game stops. Now add the following: 1. 2. 3. 4. 5. A third sprite that is the food you need to catch This food sprite moves like the Cat. When the player sprite touches the food, you gain a point (the point variable increase increases by 1) When you get to 3 points, the Stage changes to the WIN screen and the game stops. When you start the game again, points goes to 0.
© Copyright 2026 Paperzz