Intro: Arduino Capacitive Touch Game
This is a game, implemented from different games like pacman and mario brothers, as you can probably see!
I got the idea to combine the capacitive touch and processing to make a game through an instructable that I saw (generally about capacitive touch sensors), and a post on the internet with a processing game! The whole point of this game is that you will be able to enjoy your game anywhere and anytime you want, if you have a pencil, paper, the arduino assembly, and your computer! Yes, there are a lot of games like this one on the internet, but having your own game controller with you is much more fun! So, let's start building our very own Arduino Capacitive Touch Game!
Step 1: Parts List
There are very simple things you need to build this!
1 x Arduino
4 x 1M ohm resistors (and several wires)
4 x longer jumper wires
4 x metal paper clips
A working pencil and a paper
A piece of cardboard (or anything similar)
Step 2: Wiring
The wiring for this project is pretty simple. You need some wires, 4 long jumper wires, and 4 1M ohm resistors.
The diagram may be a little different since it uses a breadboard, not a shield, but it is identical otherwise. It is very simple!
- On one side of the resistor, connect to power (5V).
- Then, on the other side, connect your wire to a digital output pin. (it will be good if you write down which pin was connected to which buttons)
- Then use the long jumper wires to connect the signal output to the paper clip.
- Repeat Steps 1-3 for all 4 resistors.
You are ready to go!
Step 3: Draw Your Buttons
Now, you have to draw your own buttons to make the controller!
- Fold the paper so that you will have a smaller surface to draw on. (follow the diagram)
- Then, draw a circle and a long rectangle that connects the circle to the edge of the paper.
- Be sure to fill in the circle completely with your pencil.
- Then, draw the same circle with the rectangle on all 4 sides of the paper.
- The result should look like the last picture.
Step 4: Assemble Your Own Game Controller
Now that you drew all the circles on your paper. It is time for you to finish the game controller.
- On each circle that you drew, make sure they are completely filled with the least amount of white spaces left.
- Grab the long jumper wire that you have and cut one end of it so that you have an exposed side of the wire where it is flexible.
- Use this exposed end and wrap it around one of the paper clips you have.
- Then, using this paper clip (with the wire facing outwards not on the side of the paper) clip the edge of the paper, where the rectangle is drawn.
- Give some space at the end of the clip (where the wire is), not attached to the paper, like the picture shown.
- Use the scotch tape to tape the paper clip on the paper, just for safety.
- Finish the button by taping the whole circle so that the pencil lead will not spread or get your finger messy.
- Repeat steps 1-7 for the other 3 circles.
- After giving final touches to all the buttons, bring your cardboard and cut it, so that it will be slightly bigger than your paper with the clips.
- Attach the paper with the buttons onto the cardboard so that you are giving the buttons a hard backboard.
Finally, now, you have a game controller!
Step 5: Arduino + Processing Code
The Arduino Code for this project is implemented from https://www.instructables.com/id/Turn-a-pencil-draw..., and the Processing Code is implemented from a project called 'AGC' that made a game on processing with blue, red dots.
The background picture for the game, named 'cartoon.png', is from [https://sites.google.com/site/seourpicz/1/games/us/3/mario-world-2]. The picture of the coin, fire, and the sign is all drawn using the SketchBookExpress app on my laptop (idea from mario brothers and pacman). The songs played during the game is from Super Mario, and the website that I downloaded them from is [http://downloads.khinsider.com/game-soundtracks/album/super-mario-world-original-soundtrack].
The code for this project is uploaded on the blog: http://ardututes.weebly.com/capacitive-touch-game....
I also attached the whole data folder that contains the pictures and the music for your convenience.
* Be sure to follow the orientation for the files like the screenshot that I uploaded. It is better to separate the processing file into two like I did on the blog.
Step 6: Enjoy Your Very Own Game!
Now you have your game!
You can change your goal score, it is currently set as 10, as high or low as you want. Change the music, images, etc. however you want! Enjoy your very own game that you created :)