watch this video ! this is a 2d game in this project we are going to build 2D game and Hardware to control game wirelessly using gestures.

Step 1: To Build Hardware and Software

Picture of To Build Hardware and Software

Gesture based Game controller and Game design Guide....(both Hardware and software !!)

Step 2: Introduction

Now a days virtual environment is considered as a means of efficient human interaction. This is defined by the diversified field of application. The range of applications include phobia therapy, military simulation, medical training etc.., The progressive advancements in the field of electronics have led to a still more widening of the spectrum of human computer interaction. The user interface approach of using keyboard, mouse, pen are not catching up to the race. The use of hand gestures as a input method providing human computer interaction. This will be useful in controlling gaming applications using hand gesture

Step 3: Block Diagram

Picture of Block Diagram

Step 4: Circuit Diagram

Picture of Circuit Diagram

Note :Xbee tx & RX is connected to 10 & 11 of arduino ....sorry for the mistake

Step 5: Components Used !!

Picture of Components Used !!

Arduino uno at Tx-#1
Arduino Leonardo at Rx-#1
Bump switches-#4
xbee s2 -#2

Step 6: Coding ..@ Arduino Leonardo

Picture of Coding ..@ Arduino Leonardo

SoftwareSerial mySerial(10, 11); // RX, TX
void setup() {


while (! Serial) {
Keyboard.begin();mySerial. begin(9600);

void loop() {
// use serial input to control the mouse:
if (mySerial. available ()){

int inChar = mySerial. read ();

switch ( inChar) {
case '1':'m'); delay(100);

case '2':;'s');delay(300); Keyboard.release(KEY_LEFT_ARROW);Keyboard.release('S');
case '3':;'s');delay(300); Keyboard.release(KEY_RIGHT_ARROW);Keyboard.release('S');
case '4':'s'); delay(500); Keyboard.release('S');
case '5':; delay(500); Keyboard.release(KEY_RIGHT_ARROW);
case '6':; delay(500);Keyboard.release(KEY_LEFT_ARROW);

Step 7: Coding ..@ Arduino Uno

Picture of Coding ..@ Arduino Uno

const int buttonPin = 6; int buttonState = 0;
const int buttonPin1 = 3; int buttonState1 = 0;
const int buttonPin2 = 4; int buttonState2 = 0;
const int buttonPin3 = 5; int buttonState3 = 0;
const int groundpin = 18; // analog input pin 4 -- ground
const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = A3; // x-axis of the accelerometer
const int ypin = A2; // y-axis
const int zpin = A1; // z-axis (only on 3-axis models ADXL335)
void setup()
pinMode(13,OUTPUT); pinMode(buttonPin, INPUT);
Serial.begin(9600); pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);

void loop()
buttonState = digitalRead(buttonPin);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
if( analogRead(ypin)>400){ // can use any direction
if( analogRead(ypin)<300){
if (buttonState == HIGH) {

if (buttonState1 == HIGH) {
if (buttonState2 == HIGH) {
if (buttonState3 == HIGH) {



Step 8: 2D Game Design !!

Picture of 2D Game Design !!

Software needed -Game editor

Game Editor is a 2D game authoring package. It supports multi platform development toiPhone, iPad, Mac OS X, Windows (95-Windows 7), Linux, Windows-basedSmartphones, GP2X, Pocket PCs, andHandheld PCs. Compatibility with these platforms is mentioned on Game Discovery,[1]a popular site for game developers, among other software like 3D Gamemaker, Darkbasic, and Game Maker.

Game Editor was created by Makslane Rodrigues, who has been developing it since 2002. The current version is 1.4.0. It is still considered to be a work in progress.

Download Game editor :

The interface itself is relatively basic and is the same for Mac OS X, Linux and Windows. Navigating the editor map (where the level is designed and executed) involves panning. The interface is composed of a main menu at the top, which shows the current position on the map, and icons indicating the mode(s) the user is in. The interface is window based. Each action and event has its own window, along with several settings windows.

Actor concept

The objects in Game Editor are known as actors. Notably, this doesn’t mean every actor has to be a character. You can add multiple graphics and animations to an actor from supported formats.


The Game Editor engine is event driven. For something to happen in your game, Game Editor handles events you create using the interaction of actors, and other game elements, the mouse and the keyboard. In Game Editor, you can customize to a very high extent what actions happen on an event.

Level creation

Game Editor provides two ways for dividing the levels of the game. One is creating separate files for each level, and then linking them with 1 or 2 functions. But if the levels are small anyway, and you don’t want to separate them so much, then you can put all levels into one file, and surround the levels with activation regions which defines the surrounded part of the file loaded in and out of the memory together.

Non-actor objects

Game Editor also allows you to create Paths, and activation events. Paths are marked as nodes in Game Editor interface, and can specify a route the actor will move on. The speed of the path can also be modified, and the path can be made up of Bezier curves and linear lines too.


I think this is a great software for anyone that want to try the hard work of game creator.
On the official site there is also a “game” area where you can download and see some games published by people and a demo area that can show you what you can do with this software.
The only bad thing of this software…is that it was not ready years ago..when i had more free time, more ideas and love for games 

Step 9: Screenshot of Game Which I Designed

Picture of Screenshot of Game Which I Designed

SDMIT is my Engineering college ! this is my final year project :)

Step 10: Xbee Pairing !!

Picture of Xbee Pairing !!

Pairing 2 Xbee is very difficult for the beginners !!
Software used XCTU or Putty these are terminal software !!

I will give a YouTube link you can follow it ,

Step 11: 2D Game Design Tutorial Videos !!

Picture of 2D Game Design Tutorial Videos !!

if you have any questions feel free to ask !!

thank you !!


AXR AMAR (author)2016-05-21

All the best !! Knex

KNEXnCoding (author)2016-05-21

Sweet! I was just shopping for Xbee radios, I'll be getting this soon! Maybe I'll try this as my first project!

AXR AMAR (author)2016-05-21

Thank you !bro

RGBFreak (author)2016-05-21

That's cool man!

About This Instructable




Bio: Electronics and Automation Engineer, Game designer, Artist! EMAIL:
More by AXR AMAR:#DIY# How to grow Bonsai (or any plant) using Internet of things (IOT)#DIY# A Complete Guide to Build Your own ATtiny85 Project PCB with Relay and Interfacing HC05 Bluetooth Module to it Pinguino Project (a PIC microcontroller based Arduino #No Programmer Required)
Add instructable to: