-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
91 lines (70 loc) · 2.45 KB
/
README
File metadata and controls
91 lines (70 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//Authors:
//Jingyuan Zhang
//Michael Boisvert
Description:
1. recreate the Snake game in the arduino.
2. including two modes(1 PLAYER MODE & 2 PLAYER MODE)
3. Apply two joystick when excuting the 2 Player mode, both are connected to one
Arduino.
4. Using an array to store the status of the snake and food.
5. Using a structure to store the co-ordinate of the snake.
6. Using a point array to store the track that the snake's head's movement.
Game Rules:
GENERAL
1. When in the menu mode, only the joystick attached with pin A0, A1, and 2
can scroll the menu.
2. Using a joystick to control the direction which the snake move towards.
ONE PLAYER MODE
1. And in the 1 player mode, only this joystick can control the snake.
TWO PLAYER MODE
1. In the 2 player mode, the snake a is the white one, and snake b is the blue
one.
2. The joystick connected to the A0, A1, 2 PIN controls the white snake a.
3. The joystick connected to the A8, A9, 13 PIN controls the blue snake b.
4. The white snake will be initialized at the right bottom corner, and move
towards left.
5. The blue snake will be initialized at the left upper corner, and move towards
right.
6. One of the snakes dies, the game will over, and the snake who longer will win
the game.If the length is same, it will be tie.
Wiring Instruction:
1. wiring the display:
Board Pin <---> Arduino Pin
===========================
GND GND
Vin 5V
3Vo NOT CONNECTED
CLK 52
MISO 50
MOSI 51
CS 10
D/C 9
RST NOT CONNECTED
Lite NOT CONNECTED
Y+ A2 (analog pin)
X+ 4 (digital pin)
Y- 5 (digital pin)
X- A3 (analog pin)
IM0 - IM3 NOT CONNECTED (they expect a 3.3v signal, DON'T CONNECT!)
CCS 6
CD NOT CONNECTED
2. Wiring joystick 1:
A1 VRx
A0 VRy
2 SW
GND GND
5V 5V
2. Wiring joystick 2
A9 VRx
A8 VRy
13 SW
GND GND
5V 5V
Upload Instructions:
Load it from Arduino IDE and upload from there. Alternatively, use the 'make upload' command in terminal while in the
directory with the makefile and cpp file.
Reference:
1. Arduino Reference
link :https://www.arduino.cc
2. Adafruit Graphics Library Documentation
link: https://eclass.srv.ualberta.ca/pluginfile.php/3891318/mod_resource/content/1/adafruit-gfx-graphics-library.pdf