This tutorial was contributed by Justin Soong from Raffles Institution.
Step 0 – Pre Build Overview
In this project, we will create a simple game, in which you bounce a ball against a wall. If you miss, you die. Too bad. For those of you who appreciate a challenge, the game increases in difficulty with each level!
MATERIALS: 1 x BBC micro:bit, 1 x Micro USB cable
- Get to know more about the microbit microcomputer
- Learn how to program a simple game
- Consider all cases
Step 1 – Components
First of all, plug the microbit microcomputer into your own computer. No other components are required.
Step 2 – Pre Coding
This will open up a dialog box. Copy and paste the following link into the Add Package… text field: https://pxt.microbit.org/50544-64675-33322-24641. Click on the search icon or press enter, then click on the Tinkercademy button.
Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu.
Step 3 – Coding
Lastly, we have a for loop which acts as a clock so that the ball keeps moving. Also, we have the onButtonPressed() functions that move the paddle.