loading

In this tutorial, we are going to show how to run a game named “Snake” on pcDuino, and controlled by Linker JoyStick Module.

About the Game Snake

Snake is a classic casual video game that many people love and are familiar with.
The player controls a long, thin creature, resembling a snake, which roams around on a bordered plane, picking up food (or some other item), trying to avoid hitting its own tail or the “walls” that surround the playing area. Each time the snake eats a piece of food, its tail grows longer, making the game increasingly difficult. The user controls the direction of the snake’s head (up, down, left, or right), and the snake’s body follows. The player cannot stop the snake from moving while the game is in progress, and cannot make the snake go in reverse.

Step 1: Step 1: Wire Diagram

The JoyStick is connected as following:

  1. GND of JoyStick -> GND of pcDuino
  2. VCC of JoyStick -> 3.3V of pcDuino
  3. x of JoyStick -> A2 of pcDuino
  4. y of JoyStick -> A3 of pcDuino

Step 2: Step 2: Running Interface

Step 3: Step 3: Source Code

Download snake source code :

http://cnlearn.linksprite.com/wp-content/uploads/2013/10/snake.zip

1. Put the source code into pcduino

2. Open the LXTerminal and cd into source code floder, and run " make all".

You must run command as ROOT when receive an "Access Denied" or a Permission Denied" scripting error message .

3. You must install curses library whe you receive cureses.h not found .

install curses library:

sudo apt-get install libncurses5-dev

4: Makefile variables in ARDUINO_PATH arduino installation directory. You can modify the actual situation

About This Instructable

577views

8favorites

License:

More by Linksprite:Using Breakout Board for ADMP401 MEMS Microphone on pcDuino Another home automation project with pcDuino How to remotely boot pcDuino from a NFS server 
Add instructable to: