2D Minecraft - Part 2 (Layers)

About this lesson

Learn to layer different blocks

Step 1

Step 2
We're going to use this dirt block, it needs to be 128px x 128px

Step 3
Upload the dirt block as a new costume

Step 4
Center at the bottom left again

Step 5
Create a new variable called BlockType. We will use this to determine what kind of block to use.

Step 6
Create a new variable called YPos, this is how we will keep track of our second layer

Step 7
Start ypos at -180 which is the bottom of the screen

Step 8
Change our start clone code to use the new YPos value

Step 9
Change our block creation code to add 2 loops, the inner one for each block, the outer one for each layer

Step 10
Change our clone creation code to switch to the right costume based on the BlockType

Step 11
Now we have 2 layers!

Step 12
Challenge: See if you can add a third layer with cobblestone

2D Minecraft - Part 2 (Layers) Info

Account

MVCode Community

Created By

doug

Access Level

public

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