"It’s Here! The BFCM Sale of the Year – Grab Your Favorites!"

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 Direction Lights of the Cutebot

Principle:

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

Program:

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.

The Direction Lights of the Cutebot

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

The Direction Lights of the Cutebot

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.

The Direction Lights of the Cutebot

Full program:

The Direction Lights of the Cutebot

Link: https://makecode.microbit.org/_V2b2AL9qpg1X

If you have any ideas or opinions, please feel free to contact us via [email protected].

Leave a Reply

images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
images
Children’s Programming Education is the Future Trend
images
Technical verification! Nezha series products can complete WRO competition tasks
images
Let's take part in the Ceremony of the New Factory of ELECFREAKS together!
images
Bluetooth Bee(HC-05 and HC-06) User Guide
images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
Monthly Archive