aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arduino_sketch/arcerino/arcerino.ino83
1 files changed, 46 insertions, 37 deletions
diff --git a/arduino_sketch/arcerino/arcerino.ino b/arduino_sketch/arcerino/arcerino.ino
index 171bdb9..869f3e4 100644
--- a/arduino_sketch/arcerino/arcerino.ino
+++ b/arduino_sketch/arcerino/arcerino.ino
@@ -43,48 +43,60 @@ void draw_board() {
}
void draw_game() {
- draw_board();
- u8g.drawVLine(x+LCD_0X,y-4+LCD_0Y,9);
- u8g.drawHLine(x-4+LCD_0X,y+LCD_0Y,9);
+ u8g.firstPage();
+ do {
+ draw_board();
+ u8g.drawVLine(x+LCD_0X,y-4+LCD_0Y,9);
+ u8g.drawHLine(x-4+LCD_0X,y+LCD_0Y,9);
+ } while(u8g.nextPage());
}
void draw_score() {
- draw_board();
- u8g.drawDisc(x+LCD_0X,y+LCD_0Y,3);
+ u8g.firstPage();
+ do {
+ draw_board();
+ u8g.drawDisc(x+LCD_0X,y+LCD_0Y,3);
+ } while(u8g.nextPage());
}
void draw_title() {
- u8g.setFont(FONT_BIG);
- u8g.setPrintPos(0,MIDDLE_TEXT_Y);
- u8g.print("Arcerino");
- u8g.setFont(FONT_SMALL);
- u8g.setPrintPos(LOAD_TEXT_X,BOTTOM_TEXT_Y);
- u8g.print("Loading...");
+ u8g.firstPage();
+ do {
+ u8g.setFont(FONT_BIG);
+ u8g.setPrintPos(0,MIDDLE_TEXT_Y);
+ u8g.print("Arcerino");
+ u8g.setFont(FONT_SMALL);
+ u8g.setPrintPos(LOAD_TEXT_X,BOTTOM_TEXT_Y);
+ u8g.print("Loading...");
+ } while(u8g.nextPage());
}
void draw_wait() {
- u8g.setFont(FONT_SMALL);
- u8g.setPrintPos(0,TOP_TEXT_Y);
- u8g.print("Your score: ");
- u8g.print(score,DEC);
- u8g.setPrintPos(0,BOTTOM_TEXT_Y);
- u8g.print("Press Z to start");
- u8g.setPrintPos(0,MIDDLE_TEXT_Y);
- u8g.print("Rank: ");
- u8g.setFont(FONT_BIG);
- if (score >= 100) {
- u8g.print("A++");
- } else if (score >= 90) {
- u8g.print("A");
- } else if (score >= 80) {
- u8g.print("B");
- } else if (score >= 60) {
- u8g.print("C");
- } else if (score >= 30) {
- u8g.print("D");
- } else {
- u8g.print("E");
- }
+ u8g.firstPage();
+ do {
+ u8g.setFont(FONT_SMALL);
+ u8g.setPrintPos(0,TOP_TEXT_Y);
+ u8g.print("Your score: ");
+ u8g.print(score,DEC);
+ u8g.setPrintPos(0,BOTTOM_TEXT_Y);
+ u8g.print("Press Z to start");
+ u8g.setPrintPos(0,MIDDLE_TEXT_Y);
+ u8g.print("Rank: ");
+ u8g.setFont(FONT_BIG);
+ if (score >= 100) {
+ u8g.print("A++");
+ } else if (score >= 90) {
+ u8g.print("A");
+ } else if (score >= 80) {
+ u8g.print("B");
+ } else if (score >= 60) {
+ u8g.print("C");
+ } else if (score >= 30) {
+ u8g.print("D");
+ } else {
+ u8g.print("E");
+ }
+ } while(u8g.nextPage());
}
void update_position() {
@@ -134,10 +146,7 @@ void setup() {
u8g.setColorIndex(1);
u8g.setContrast(192);
nunchuk_get_data();
- u8g.firstPage();
- do {
- draw_title();
- } while(u8g.nextPage());
+ draw_title();
delay(4000);
new_arrow();
new_round();