Cubefield

Step 1
What you will be making.
Step 2
Our first step is to make a new sprite. This sprite will be our start button. Follow the video to see how to make one.
Step 3
Make 3 new variables and name them score, speed, and start
Temp1403742252

Step 4
Now add this block of code to your start button sprite.
Temp1403742325

Step 5
Now make a new sprite in the shape of a triangle like this. Make sure to center it.

Step 6
Make another new variable and name it x velocity.
Temp1403742667

Step 7
Add this block of code to your triangle sprite. This will allow our triangle to move left and right and will let the game know when to start.
Temp1403742796

Step 8
Add this to the triangle sprite to set its starting location. You want your triangle to be in the middle of the screen.
Temp1403744254

Step 9
This is how your game should look.
Step 10
Follow along with the video and make a new cube sprite. Don't forget to give it 4 different costumes.
Step 11
Now make 2 new variables and name them size and x
Temp1403745185

Step 12
Once you have created those 2 new variables, add this block of code to your cube sprite. This will make the cube move and change speed.
Temp1403745324

Step 13
Add these two blocks of code to your cube as well so that the cube knows when to switch costumes.
Temp1403745424

Step 14
Duplicate your cube sprite 2 times. Make sure you change the first costumes color to something different for the 2 new cubes.
Temp1403745780

Step 15
Now duplicate each color 3 times. You should have 3 red cubes, 3 orange cubes, and 3 yellow cubes.
Temp1403745894

Step 16
Once you have made your cubes, start on making the backgrounds. Follow the video to see how to make the backgrounds.
Step 17
Make 2 more new variables and name them timer and 60 seconds.
Temp1403746432

Step 18
Add this block of code to your stage. This script will tell the game when it needs to speed up and when to start.
Temp1403746539

Step 19
Also add these 3 small blocks of code to the stage as well. This will tell the game when to switch the background and when to reset the background.
Temp1403746615

Step 20
Make a new sprite like this. This will pop up if we lose to the game. Make sure that it covers the whole screen and is a sprite, not a background.
Temp1403750673

Step 21
Go back to the triangle sprite and make a new message. Call the new message GAME OVER.
Temp1403750884

Step 22
Now add this block of code to the triangle sprite as well as our new GAME OVER broadcast. Follow the video below to see how we are going to add the rest of the sprites to this block.
Temp1403750956

Step 23
Follow the video to see how to add the rest of the sprites by using the duplicate tool.

Step 24
This is what the script should look like.
Temp1404771697

Step 25
If you want, go back to your triangle sprite and make a new 3D costume.
Cubefield Info

Account

MVCode Community

Created By

Img 0819 teddy

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