MVCode Dash 3

Planning
Step 1
In this lesson, we will make Hazard triangles move and cause the game to end if the player touches them
30
Step 2
Add this code to make the Hazards clones move and delete at the left edge
31
Step 3
Add this to the Player to cause it to crumble when it touches a Hazard
32
Check Your Work
Step 4
Test to see if the Hazards move and your player crumbles when it touches it
Information
Step 5
We are going to be sending a message from the Player to tell the other Sprites to stop moving
33
Step 6
Broadcast the message "Game Over" when the Player touches a Hazard

Step 1: Make a New Message

35

Step 2: Name it "Game Over"

36

Step 3:Broadcast when the Player hits a Hazard

37
Step 7
Inside Ground and Hazard, let's stop all scripts when "Game Over" message is received

Inside the Ground sprite

40

Inside the Hazard sprite

41
Check Your Work
Step 8
Check if the Ground and Hazard stops moving when the player crumbles
Information
Step 9
Next we are going to make a function that will spawn a group of enemies together
42
Step 10
Make a New Block and call it "spawnEnemy"

Step 1: Click this to Make a Block

43

Step 2: Name the Block "spawnEnemy"

44

Step 3: Add a number input named "enemyCount"

45

Step 4: Press OK

Step 11
Now lets define the function to repeat spawning Hazards clones
46
Step 12
Let's test it by spawning a double hazard 3 seconds after the game start
47
Check Your Work
Step 13
Test your game

We should see a double hazard group after the first

Challenge
Step 14
Can you make a triple hazard group 6 seconds after the game start?
Planning
Step 15
This lesson is now complete!
48

The next lesson will be adding platforms to our game

MVCode Dash 3 Info

Account

MVCode Clubs

Created By

Missing tiny aaronjau101

Course:

MVCode Dash

Access Level

premium

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach