-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTetris.cpp
46 lines (32 loc) · 928 Bytes
/
Tetris.cpp
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
#include <util/delay.h>
#include "lib/wiring.h"
#include "lib/startup.h"
#include "lib/SubPGraphics.h"
#include "data/HiScores.h"
#include "controls/InputShield.h"
#include "screens/Screen.h"
#include "screens/LandingScreen.h"
void setup(InputShield* input_shield) {
/* Clear the screen */
background(0);
/* Wait for serial connection */
fill(0,0,0);
stroke(255, 0, 0);
text("Waiting for Arduino...", 5, 210);
while (!input_shield->inputDataAvailable()) { }
}
int main(){
//initialise screen
init();
//display the startup screen and fading logo
sketchEarlyInits();
InputShield* input_shield = new InputShield();
uint8_t max_player_name_chars = 3;
HiScores* hi_score = new HiScores(max_player_name_chars);
Screen* screen = new LandingScreen(input_shield, hi_score);
while(true){
screen->activate();
screen = screen->getNextScreen();
}
return 0;
}