DIY Game With Gamepad Using a Makey Makey.

by djakobuslutz in Circuits > Computers

289 Views, 2 Favorites, 0 Comments

DIY Game With Gamepad Using a Makey Makey.

VID-20230225-WA0005 (2).mp4
20230225_180638 (1).jpg
20230225_174501.jpg
20230225_175035.jpg

Hello and welcome to my tutorial for how to code a cool game yourself and build a cool gamepad using a Makey Makey. You can find my finished scratch game by clicking on the link and remix it to your own comforts.

Supplies

FOR THE SOFTWARE

  • Scratch (you can go to the website or download the app)

FOR THE GAMEPAD

  • Makey Makey
  • Cardboard (it can be any cardboard)
  • Tinfoil (you can find some in your kitchen)
  • Glue (it can be any glue)
  • Alligator clips (you can get some at an electronics store)

Getting Ready

Firstly we have to find or create a game, so head over to the scratch website and search ''Space man adventures" (if you want to skip the coding part you can just click here for the finished game and skip to Step 5 for the game pad)

Design the Levels

If you already pressed the green flag and played the game you may have realized that the levels are not really exciting, just a boring floor, roof and a stickman. If you want to keep it that way you can, but I really don't think you want to, so head over to the sprite named "level" and go to the sprite's costumes. Scenes 1-6 are all part of Planet 1 (Level 1) and Scene 7-12 are all part of Planet 2. Scene 13 is the Boss level (but we will talk about the Boss level later). If you touch the red color (with the fill of color 0, saturation 100 and brightness 100) you will die and restart the level. If you touch the purple color (with a fill of color 86, saturation 100, and brightness 100) you will complete the level and go to the home page. Now fill the Scenes 1-12 with cool obstacles and remember that if you touch the red color (with the fill of color 0, saturation 100 and brightness 100) you will die and restart the level.

Sounds and Songs

Great, now you have desinged the levels but the sprites still need sound and the game needs a theme. For the song, head over to the backdrop, click on the sound bar, choose a sound from the loops section (my favorite is the Video Game 2) and then click the flag again. You may have realised that there is a speaker at the start of the game that seems to be playing a sound but no sound is coming out of it, so head over to the sprite named "story" and go to the sound bar. Record a sound like "Hello ladies and gentlemen and welcome to the k15 space shuttle" You can even put the speed on x2 and include youre epic story for your unique game. Play your game and you may realise that if your recording stopped the speaker keeps moving, so head over to the coding bar and go to the place I labelled with a note that says "Change the repeat block so that it fits the length of your recording." Change the amount that your loop repeats to the magic number that fits your recording. (Tip: if your recording is too long then increase your number and if your recording is too short then decrease the number.)

Boss Level

Screenshot 2023-02-26 190939.png

For the Boss level I made the evil character arrive on a hover board and attack my main character, the spectacular stickman, with lasers. You can easily change the evil character's words and costume if you want to. Now, make a cool platform which is surounded with a red frame (with the fill of color 0, saturation 100 and brightness 100) so that you can not just jump to the next scene. (You can see an example above.) Next, go to the Space man sprite and go to where I left a note. Connect the game pad with your computer and then attach the "key up arrow pressed?" block to the "not" block.

Game Pad

20230225_175035.jpg
20230225_174501.jpg

Well done! You are now done with all of the coding. My idea was to make a board so that if you step to the right on the board, your character will walk to the right and if you step to the left on the board, your caracter will move to the left. If you jump, he will also jump. I therefore brought this idea to reality by using a Makey Makey. Firstly, you have to fetch a piece of cardboard and cut it in any shape (preferably a rectangle) or size. (Don't make it too small, because you need to be able to jump on it.) Then fetch your Makey Makey or buy one if you don't have one. A Makey Makey works with an electrical current so if you touch the up arrow and the earth at the same time on the Makey Makey the electricity will run through you and the Makey Makey will send a message to your computer that says "I just pushed the up arrow key. So hook up some alligator clips to the up, right and left arrow and earth and connect your Makey Makey to your computer. If you are done with that you can paste some tinfoil on the left side, in the middle and on the right side of your piece of cardboard. It must look like the picture above. Then connect the alligator clip, of which the one end is connected to the right arrow of the Makey Makey, to the tinfoil on the right side of the cardboard. Connect the alligator clip, of which the one end is connected to the left arrow of the Makey Makey, to the tinfoil on the left side of the cardboard. Connect the alligator clip, of which the one end is connected to the up arrow, to the the piece of tinfoil in the middle of the cardboard. For the alligator clip that is attached to the earth section of the Makey Makey, I've joined three alligator clips together to make one long alligator clip and held the other end in my hand.

How to Use It

You are now officially done! All you have to do now is learn how to use it and play the game. If the game starts, stand on the tinfoil piece in the middle of the board and if you jump, the stickman will jump. If you want the stickman to walk to the right, then touch the tinfoil piece on the right with your foot and it works exactly the same with the left side.


I hope you enjoyed coding and building this game, because it was surely a lot of fun for me!