Introduction: DIY Snake Game
Funny game is coming!
Wow! it is a snake, but you will know how wonderful, amazing ,surprised it is !
I am using IIC_LCD for the monitors of the project as it has built in rich API which is perfect for this. It can reduce the difficulty of making, so that we can focus on the coding of the game.
The main board is from seeduino lotus of seeedstudio company.It is an ATmega328 Microcontroller development board.
Even though the algorithm of the snake is very simple, there are many interesting points.
1.Snake never moved backwards.If you have played snake game, you know that you can't control the snake moving backwards,because if the snake hit itself, the game will be over.
2.Eating food, the snake body will be grow longer.
3.Bite itself, gameover.
4.Food's position.Food have to appear randomly, and it must not appear in snake body.
5.The snake couldn't get to the rim, otherwise it will die.
You will need:
Step 1: Connecting the Modules to the Seeeduino Lotus Board
1. I2C_LCD --> I2C port (SCL, SDA, VCC, GND)
2. Grove-Thumb Joystick --> A0 port
Step 2: Install the Library for I2C_LCD
Download the I2C_LCD Library from I2C LCD wiki page(chapter--How to use?) and install it to Arduino IDE.
Open Arduino IDE, click Sketch -> Include Library -> Add .ZIP Library.
Step 3: Coding
- Download the arduino demo project to your computer(File name:snake_for_iic_lcd.zip).
- Unzip file.
- Open project using Arduino IDE.
- Upload the program and enjoy yourself!
Step 4: How to Play?
1:Power on and you will see start the page.
2:According to the screen reminder,"down key to start" .
3:You can press "up","down","left", "right" to realize the movement of snake.
4: Eat the food as many as possible,every time you will get 10 scores(The initial score:50).
5: Higher scores means more food in the snake stomach, and professional skill you have.
Why not put the snake game in the living room to get more fun, l think all of your friends will enjoy it.Aha, trust me,it is a wonderful game.