For my project 4 I made a rocket ship out of cardboard to control a game I made in makecode arcade. It uses an ultrasonic sensor and a CPX to work. The controller moves the ship on screen up and down. As well, the ship can make the rocket shoot on screen. The game is just an endless runner dodging or shooting asteroids until you are hit by one.
The ultrasonic sensor works by measure the distance from the ship to a flat surface. When the distance to small it presses “S” on a keyboard moving the ship down. When the distance is larger between the two, it presses “W” on a keyboard moving the ship up. I used the code from the Adafruit website for an ultrasonic sensor and tweaked it a little to press keys. To make the ship shoot on screen, when you shake the CPX it will press “Q” making the rocket shoot it’s blast.
Comments
Please log in or sign up to comment.