Micro:bit Reaction Ability Test
Hello, today I will use micro:bit to make a simple reaction test game. There is a small bright spot on the LED matrix that moves left and right. When the bright spot moves to the middle, press the A button, if the bright spot is in the middle of the screen when the button is pressed, you will get one score, otherwise the game is over and the moving speed of the bright spot will continue to increase as the game progresses in order to increase the difficulty. GIF displays:
The bright spot is a sprite that keeps moving back, forth, left and right. When A button is pressed, the micro:bit judges whether the x coordinate of the current bright spot is 2 or not. If it is 2, it means it is the target position. If not, the game is over. We need an additional variable to save the movement interval time of the highlight. Each time the player presses the right button, the movement interval will be shortened so that the highlight will move faster
Go to: makecode.microbit.org
Create a variable named as “lightspot”
1.While on start, create a spirit on the middle of the screen and assign it to the variable.
2.Create a new variable name as “time interval” and set it as 600.
1.In forever brick, set the lightspot keeps moving with 1.
2.Set the lightspot reverses once it touches the edge of the screen.
3.Pause time interval
1.Drad on button A pressed brick.
2.If x of the lightspot is 2, change the score with 1.
3.Set “time interval” as time interval – 50.
4.Or the game is over.
If you have any ideas or opinions, please feel free to contact us via firstname.lastname@example.org.
Share this post
About the Author
ELECFREAKS focuses on microbit and publishes interesting articles
- Micro bit supplier
- Wholesale Suppliers
- Micro bit tutorial
- Micro bit classroom pack
- Mcorbit Environment Monitoring
- TPBot car
- Micro:bit car
- AI Lens
- Micor:bit AI Lens
- Microbit gyroscope
- Micro:bit LEDs
- BBC micro:bit
- Micro:bit Manipulator
- Wukong board
- Micro:bit Motorcycle
- Nezha breakout
- Micro:bit DIY
- 360° servos
- AI Lens
- Retro Arcade
- Microbit programming
- Do your:bit
- Rainbow LED Ring
- Wonder Building Kit