diff options
author | Elena of Valhalla'' Grandi <valhalla.trueelena.org> | 2013-04-11 17:36:09 +0200 |
---|---|---|
committer | Elena of Valhalla'' Grandi <valhalla.trueelena.org> | 2013-04-11 17:36:09 +0200 |
commit | 7e8d5f67db0aa4eef21d16e7a26d7ceae1cfccd4 (patch) | |
tree | 8839dbef9a167d791cadcff474791733246ea366 | |
parent | 6777c3b4939c5a7a7dc79311ce3a9e85ea3d568f (diff) |
arduino sketch: fixed score
-rw-r--r-- | arduino_sketch/arcerino/arcerino.ino | 6 |
1 files 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; |