2.0 Small Dinosoar - a Realistic Playing Game :)

by JUST_INCAPABLE in Circuits > Arduino

31 Views, 1 Favorites, 0 Comments

2.0 Small Dinosoar - a Realistic Playing Game :)

2024-06-16 09.11.55拷貝.jpg

Game Description: 2.0 Small-Dinosaur


2.0 Small-Dinosaur is an engaging and interactive game for fun and physical activity. Players control a small dinosaur character that moves and jumps to avoid obstacles. The unique aspect of this game is that it requires players to physically move and jump in real life to control the dinosaur within the game, making it a great way to combine gaming with exercise.

Arduino Circuits

電路圖.png

In the picture above, the ultrasonic sensor's TRIG pin is connected to D9, and the ECHO pin is connected to D10. The LED is connected to D8.

Arduino Code

This code snippet demonstrates how to use an Arduino to control a game character through physical movement using an ultrasonic sensor and an infrared (IR) sensor. The Keyboard library is used to simulate keyboard inputs, which can be utilized in a Scratch game to control a small dinosaur character.

  1. Ultrasonic Sensor: Measures the distance to an object. If the distance is greater than a specified threshold, it sends a space (' ') keystroke, simulating a jump.
  2. LED: This gives the ability to check if your foot is in place.


Notice About Arduino

Please stick the ultrasonic sensor to a cup and try to stick it at the BOTTOM side!!!

Scratch Code

Below is a link to see the full game:

https://scratch.mit.edu/projects/1038035834


Why You Should Try 2.0 Small-Dinosaur:

Interactive Fun: Combining physical activity and gaming makes for an exciting and engaging experience.

Educational Value: It introduces basic concepts of electronics and programming in a fun, hands-on way.

Exercise: Encourages players to be active and move, promoting a healthy lifestyle.