From 7e8d5f67db0aa4eef21d16e7a26d7ceae1cfccd4 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Thu, 11 Apr 2013 17:36:09 +0200 Subject: arduino sketch: fixed score --- arduino_sketch/arcerino/arcerino.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arduino_sketch/arcerino/arcerino.ino b/arduino_sketch/arcerino/arcerino.ino index 72329c5..e19b00a 100644 --- a/arduino_sketch/arcerino/arcerino.ino +++ b/arduino_sketch/arcerino/arcerino.ino @@ -173,7 +173,9 @@ void draw_game() { void draw_score() { TV.clear_screen(); draw_board(); - TV.draw_circle(x+LCD_0X,y+LCD_0Y,6,WHITE,WHITE); + if ( x > -LCD_MAX && x < LCD_MAX && y > -LCD_MAX && y < LCD_MAX ) { + TV.draw_circle(x+LCD_0X,y+LCD_0Y,6,WHITE,WHITE); + } TV.delay(3000); TV.clear_screen(); } @@ -227,7 +229,7 @@ void update_position() { } char get_score() { - int d = sqrt(pow(x,2) + pow(y,2)) / 4; + int d = sqrt(pow(x,2) + pow(y,2)) * 6 / LCD_MAX ; switch(d) { case 0: return 10; -- cgit v1.2.3