aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena of Valhalla'' Grandi <valhalla.trueelena.org>2013-04-05 23:05:54 +0200
committerElena of Valhalla'' Grandi <valhalla.trueelena.org>2013-04-05 23:05:54 +0200
commit8bf53229c6d826ab40be57ba144681ec50aebdf2 (patch)
tree52a7553c3c8bda5ff017ee4a0df9784e46de3d32
parentca53c7cfe9ad46e742b18b82728eee758ee6b145 (diff)
Arduino sketch: improved scoring
-rw-r--r--arduino_sketch/arcerino/arcerino.ino11
1 files changed, 9 insertions, 2 deletions
diff --git a/arduino_sketch/arcerino/arcerino.ino b/arduino_sketch/arcerino/arcerino.ino
index ba1a6fa..fe582c8 100644
--- a/arduino_sketch/arcerino/arcerino.ino
+++ b/arduino_sketch/arcerino/arcerino.ino
@@ -25,6 +25,7 @@ void draw_game() {
u8g.drawCircle(42,24,24);
u8g.drawCircle(42,24,16);
u8g.drawCircle(42,24,8);
+ u8g.drawCircle(42,24,4);
u8g.drawVLine(x+LCD_0X,y-4+LCD_0Y,9);
u8g.drawHLine(x-4+LCD_0X,y+LCD_0Y,9);
}
@@ -36,6 +37,7 @@ void draw_score() {
u8g.drawCircle(42,24,24);
u8g.drawCircle(42,24,16);
u8g.drawCircle(42,24,8);
+ u8g.drawCircle(42,24,4);
u8g.drawDisc(x+LCD_0X,y+LCD_0Y,3);
}
@@ -58,16 +60,21 @@ void update_position() {
}
char get_score() {
- int d = sqrt(pow(x,2) + pow(y,2)) / 8;
+ int d = sqrt(pow(x,2) + pow(y,2)) / 4;
Serial.println(d,DEC);
switch(d) {
case 0:
return 10;
break;
case 1:
- return 5;
+ return 6;
break;
case 2:
+ case 3:
+ return 3;
+ break;
+ case 4:
+ case 5:
return 1;
break;
default: