MVCode Dash 4

Planning
Step 1
In this lesson, we will make the player able to land on top of the platform or crash into the side of it
50
Step 2
Start by making the Platform clones move to the left similar to the Hazard clones
49
Step 3
Now let's make the player able to land on top of the Platform

Change this part of the code inside the Player Sprite:

51
Check Your Work
Step 4
Check if the player can land on the platform
Step 5
The Player should also be able to jump on the Platform

Change this code inside the Player sprite:

53
Check Your Work
Step 6
Check to see if the player can jump on the platform
Step 7
Now the Player needs to crash into the side of the Platform

Change this code inside the Player sprite:

56
Step 8
Let's also make the Platforms stop moving when the player crashes
55
Check Your Work
Step 9
Check to see if the player can crash into the platform
Challenge
Step 10
Create a new Block named "spawnPlatform" that has a number input named "platformCount"

This will be used to spawn groups of platforms together just like the Hazards

57

Hint: Look in this section of the code blocks:

1
Step 11
Now define the spawnPlatform block so it will create a group of platform clones
2
Step 12
Change the Platform code to spawn a big group at the start
3
Check Your Work
Step 13
Check if the platform group appears
Planning
Step 14
We will now be making a new platform that will go on top of the first one
5
Step 15
Right click the Platform sprite and Duplicate it
4
Step 16
Change the starting y position for Platform 2
7
Check Your Work
Step 17
The second platform should now appear on top of the first

The player collision does not work yet!

8
Step 18
Make the player able to land on top of Platform 2
9
Step 19
Then make the player able to jump on Platform 2
11
Step 20
Finally make the player able to crash into Platform 2
10
Check Your Work
Step 21
The second platform should now work like the first one
14
Challenge
Step 22
Create your own level by spawning Hazards and Platforms

Get creative! Here's the one I created (I'll show how my code is set up below)

12 13 16
Planning
Step 23
This lesson is now complete!

The next lesson will be adding the final touches including Score and a You Win screen

17
MVCode Dash 4 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