Drawing the Numbers and Adding the Numbers in Space Mine 3D!
Get your goggles on, and prepare for the mission of a lifetime. In Space Mine 3D, you have to pilot a spaceship to intercept debris as it flies out of a space vortex. If it spirals off into space, your space station might be hit.
This project runs too
slowly for the 3D effect
to work on the Raspberry
Pi Model B+, so use a
newer Raspberry Pi or
Scratch 2.0 if you can.
You use the left and right arrow keys to move clockwise and counterclockwise around the edge of the vortex. It’s a game of quick thinking: if you go the wrong way around the circle, you’re more likely to miss the debris. You have 30 seconds to catch as much as you can.
The game is based around a tunnel of circles that appears to sink into the screen. The game begins with a countdown effect, where the numbers from 5 to 1 disappear into the tunnel. This adds a great sense of 3D depth before the game begins, and then the blobs of debris start flying out of the tunnel towards you.
This game uses the anaglyph 3D effect you’ve already explored in previous chapters, so you’ll need your 3D glasses again. As before, the 3D effect doesn’t work on the page but I’ve included some images to help you check your project is working okay.
As always, take regular breaks away from the screen and the 3D glasses to avoid getting tired eyes.
The 3D effect only works on the computer screen. For a sneak preview of this game in 3D, go to www.ineasysteps.com/cool-scratch-projects-resources/ or the author’s website.
Drawing the Numbers
One cool effect in this game is the countdown at the start, which uses large numbers that drift off down the tunnel.
Give the cat this new script. Don’t join it to any other script.
Click the script and you will see a large digital number 8 drawn on the screen. If your image looks wrong, check the numbers in the repeat blocks and the numbers in the turn and move blocks. Make sure the change y by -116 block is between the right yellow brackets.
Right-click or Shift + click the Stage and save the image.
Now you’ve drawn the images you need for this project, you can save your project and start a new one for the game.
Below: The image drawn
by the script.
To see how this script works, add a wait 1 secs and a show block inside the repeat 4 bracket as the first blocks. You can add wait blocks anywhere to pause the script so you can see even more clearly what it’s doing.
Adding the Numbers
Click the button with a folder on it above the Sprite List to add a sprite from an image. Add your number outline.
Click the Costumes tab. In Scratch 1.4, click the Edit button. Choose the Fill tool and use the red ink inside all the shapes to make a filled 8 shape.
Choose the transparent ink and click outside the 8 to remove the white color. Click OK in Scratch 1.4.
Duplicate the costume until you have six “8” costumes. In Scratch 2.0, right-click or Shift + click the costume and choose duplicate. In Scratch 1.4, click the Copy button beside the costume in the Costumes Area.
Edit the first costume and erase the panes you don’t need for a number 1. Repeat with the other costumes, so you have costumes for the numbers 1 to 5, plus an 8.
Now you need to duplicate the sprite with all its costumes. Right-click or Shift + click the sprite in the Sprite List and choose duplicate.
In the duplicated sprite, edit each costume in turn and fill all the number panes with cyan ink.
You should now have a red sprite and a cyan sprite. Each sprite should have the numbers 1 to 5 on it in order, plus a number 8 costume.
Left: The filled-in number 8 with the white surrounding color removed.
Use the same red and cyan colors as you used for 12 Angry Aliens. See the section “Testing the anaglyph effect”, on page 58 (Cool Scratch Projects in easy steps).
For more Cool Scratch Projects, all in the trusted In Easy Steps style, click here.
Following on from the success of Scratch Programming in easy steps, Cool Scratch Projects in easy steps gives you great ideas to create computer games and other projects that’ll impress your friends and family – and you’ll have endless fun creating and playing them! All in full-colour and straightforward, jargon-free language!
See also: Cool Scratch Projects – Digital Scoreboard, Exploring the Blocks Palette – Scratch Programming, and the complete Scratch Programming guide, Scratch Programming in easy steps!