Distributors / Retailers
Device Manufacturers
Blogs / Journals
Forums / Discussion Groups
Social Media (Official Sites)
Special Projects
Other Resources
As featured in the Gadget Radar Blog
Arduino Games
HOME  |  DOWNLOAD GAMES  |  APPS





Meet Grace
+ = FUN !!!
When you of think of the Arduino, you think of games. Right? Well, maybe you should. The Arduino platform is excellent for writing simple games. Even games with action can be written for the Arduino. First, you need to select the Arduino device you would like to use. I would suggest the Arduino UNO R3 microcontroller board. Then, you will need to attach some type of display device, such as the Seeed Studio Touch Shield V2.0 LCD touchscreen display. Now, you are ready to begin writing the code for your game. Refer to the code block below to view some functions you can use in your game programs.
//Here are some functions to get you started

int x; int y; // global variables (declare these before the setup() block in your program)

//Returns TRUE if the last touch (using global variables x and y) was inside the box from (x0,y0) to (y0,y1)
boolean touchBox(int x0, int y0, int x1, int y1) {
if (xx1 || yy1) {return false;}
return true;
}

//Returns the last touch position (as global variables x and y)
boolean touchPosition() {
Point p = ts.getPoint();
if (p.z > __PRESURE)
 {x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
  y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
  return true;} else {return false;}
}

//Returns the last touch position (as global variables x and y) and waits for touch status to be stable
boolean touchStatus(void) {
int steady=0; boolean newState=false; boolean oldState;
while (steady <20)
  {oldState=newState; 
   Point p = ts.getPoint(); if (p.z > __PRESURE)
    {newState=true; x = map(p.x, TS_MINX, TS_MAXX, 0, 240); y = map(p.y, TS_MINY, TS_MAXY, 0, 320);}
    else {newState=false;}
   if (newState == oldState) {++steady;} else {steady=0;} 
   delay(5);
  }
return newState;
}

//Waits for the user to touch and release the screen. Also uses the time that the user waits before
//pressing the screen to seed the random number generator.
void touchWait(void) {
while (!touchStatus()) {++rsd; if (rsd>10000) {rsd=0;}} //
while (touchStatus()) {}
}
You can select the "DOWNLOAD GAMES" link at the top of this page and download some games I have written. I especially enjoyed writing the "Aliens" game. Each ZIP file contains a folder and an ".ino" file. After downloading a file to your computer, simpy use the Arduino IDE to upload the game to your Arduino microcontroller board. Because the ".ino" files are in plain text format, you can view my code for each of the games. When writing your games, you can use some of my functions which are displayed in the code block above. I hope you have a really great time writing games for the Arduino microcontroller system.

On the left side of the screen, you will notice a group of links that I thought you might find to be useful. You can also check out the collection of Arduino-related apps by clicking the "APPS" link at the top of the screen.

I plan to continually add new Arduino games to this website. I will also investigate the possibility of adding other resources to this site, such as non-game Arduino applications. Please check back often for updates. You never know what you might find. Thanks for visiting my site.
Click here to get 500MB of 4G data per month FREE FOR LIFE from FreedomPop