Supported platforms
- Desktop web browser – Chrome, Edge, Opera
- Android
- ChromeOS
- iPhone or iPad – via Bluefy web browser
Goal of this APP
Blockout is a very basic arcade-style game. You control the paddle left and right trying to catch a bouncing ball, the ball destroys blocks on the top of the screen. your goal is to destroy all the blocks, you loose when the ball falls down.
How do you control the paddle – WITH YOUR MICRO:BIT!
But this app is not about playing this game – this would be boring.
Our goal is to design the game controller.
You use the Micro:Bit but there is no one method how it controls the paddle – YOU DESIGN IT!
What can you do?
- use accelerometer to convert M:B angle into paddle position
- use A and B buttons to move the paddle left and right like in a regular gamepad
- connect bananas to inputs pins to turn them into buttons
- build a ballance board to stand on and detect its position with Accelerometer
- use your imagination!
Design thinking
This app is a nice excerise with design thinking pattern.
- IDEA – imagine how do you want to control the game
- PROTOTYPE – code it, if it has any physical additions – build it
- TESTING – play the game with your controller – test how it works, was your idea effective, is there something to improve?
- REPEAT THE CYCLE – to improve on your experience
Do not provide “correct” solution to your students, let them experiment, work in groups and test each others ideas.
Make a Blockout competition in the end.
I hope you will have fun.
How to work
- Design your control pattern – what control pattern and sensor do you want to use?
- Build the controller prototype (if it has any additional parts except the Micro:Bit)
- Code your Micro:Bit in MakeCode
- The app expects to receive the paddle position as a number ranged 0-100, sent via bluetooth.
- In the app click ROBOT HEAD icon in the upper right corner to connect to your Micro:Bit
- If your micro:bit is not detected by your computer, check if project settings in MakeCode look like this
App settings
You can modify the game conditions a bit by changing
- Number of rows and collumns of blocks to break
- Speed of the ball
- Width of the paddle
To set your settings modify the URL adress of the APP with parameters as below:
https://cardboard.lofirobot.com/blockout-microbit/?rows=5&cols=10&speed=3&paddle=3
Change the parameters in the URL: rows, cols, speed, paddle.
This way to share this conditions with someone else simply pass the link with your parameters.
Example code
Buttons control
Tilt control
Troubleshooting
Micro:Bit v1 has limited memory. It becomes a problem when you use bluetooth as it takes most of RAM. The board will crash when you will try to make it use bluetooth and anything more than one sensor and basic operations.
When you are low on memory you will see a sad face and error code 20 on Micro:Bit display after connecting via bluetooth.
How to avoid this error?
- Keep your code as simple as possible
- Use only one sensor at a time
- Avoid using led display when connected to bluetooth
- Limit mathematical operations such as dividing, rounding etc.
- Use Micro:Bit v2 – the easiest way (SORRY) it has much motre memory
In the end with Micro:Bit v2 it is still possible to do most of interactions but it is frustrating for students (and the teacher) to encouter low memory error time after time and trying to avoid it.
Micro:Bit v2 has enough RAM memory (128kB vs 16kb in the old one) that you will not face this problem.