Hello, my name is Carlos Soto (email@example.com), I am an engineer working in programming for kids. This is my second post in this platform, we continue to focus about “why teach programming to younger kids?”, we would like to share with this Robociti community some simple but interesting projects to get fun and engage students in their first steps with Raspberry 3.
This GAME called “Sonic”, the original one was designed by SEGA in 1991. Today we will share a simple game to learn how to use Scratch 2 with Raspberry 3, also using a 2-bottom joystick (GPIO extension from Scratch). The GAME consists in get coin that fall from up to down. Each coin will increase a variable “points” by 1, and if the point didn’t catch, the variable “point” will decrease by -2.
We prepared a video when you can check the GAME idea and check circuit and interface during the game duration,
To explain this project, we can begin for two-botton joystick, we will use the pins 17, 18 as digital outuput (leds), and pins 20, 21 as buttons (digital input -two botton joystick-) . The circuit is in the following picture.
This is just the first part of this GAME, in scratch we will add more details and more rules, also we are working in the python programming to add more complex rules and improve the performance. But, talking about this first simple part, we define just one rule, if the coin touches hedgehog, the point will increase by 1, and if the coin touches the floor (brown color), the point will decrease by 2 points, we can add details as jump, bombs, obstacles, more coins, and so on.
In the following blocks, we can see how to access to GPIO to use two-button joystick, we can use the button to move the hedgehog to Left and Right and also turn on a led according to input. For using digital input to play, the important detail is how to uses GPIO extension from Scratch 2, in the code we can see these blocks in black color.
Did you like the idea? Do you want to play? just try, if you have any questions, comments, or suggestions, just write here. your ideas are welcome, our proposal is to add more parts of this GAME using Scratch and make this GAME using python to add complex structure and play.