-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cave-Run.ino
67 lines (54 loc) · 1.09 KB
/
Cave-Run.ino
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
/**
* Cave-Run.ino - The main game file
*/
#include <LiquidCrystal.h>
#include <LedControl.h>
#include <EEPROM.h>
#include "Constants.h"
#include "SystemModule.h"
#include "MenuModule.h"
#include "GameModule.h"
#include "StateChanger.h"
#include "SetupModule.h"
#include "ThemeSongModule.h"
void setup() {
joystickSetup();
stateChangerSetup();
memorySetup();
lcdSetup();
matrixSetup();
buzzerSetup();
Serial.begin(BAUD);
randomSeed(analogRead(RANDOM_PIN));
}
void loop() {
computeJoystickValues();
switch (systemState) {
case SYSTEM_STATE_SPLASH:
doSplash();
break;
case SYSTEM_STATE_MENU:
menuLoop();
break;
case SYSTEM_STATE_MENU_ABOUT:
aboutLoop();
break;
case SYSTEM_STATE_MENU_HIGHSCORES:
highscoresLoop();
break;
case SYSTEM_STATE_MENU_SETTINGS:
settingsLoop();
break;
case SYSTEM_STATE_NAME_EDIT:
nameEditLoop();
break;
case SYSTEM_STATE_GAME:
gameLoop();
break;
case SYSTEM_STATE_GAME_END:
gameEndLoop();
break;
}
themeSongLoop();
delay(2);
}