Step 1: Make it
What is it?
Learn how to make a wireless game controller with your micro:bit and Scratch - and help feed tacos to your dinosaur!
How it works
- To play the game, connect your micro:bit to Scratch, then tilt it to move the dinosaur to catch and eat tacos.
- Every time the dinosaur touches a taco the points variable increases by 1.
- Avoid the bugs – touch them and the points variable is reduced by 1.
- The program uses the micro:bit’s accelerometer input readings to sense which way you tilt it.
- It then uses selection to decide what happens next: if you tilt it to the front or back it moves the dinosaur sprite up and down (in the Y-axis).
- If you tilt it left and right it moves the dinosaur across the screen in the X-axis.
- The program also sends your score to the micro:bit so it appears on its LED display output.
What you need
- micro:bit and optional battery pack
- suitable computer with Scratch link installed. See https://scratch.mit.edu/microbit for details on how to get Scratch working with micro:bit
Step 2: Code it
Step 3: Improve it
- Add a winning or losing score to end the game.
- Add more bugs or tacos or other goodies and baddies.
- Add levels to the game to make it harder as you progress.
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.