quick cleanup of old code
This commit is contained in:
@@ -60,8 +60,6 @@ def read_buttons():
|
|||||||
else:
|
else:
|
||||||
sw2_t = 0
|
sw2_t = 0
|
||||||
return(sw1_t + sw2_t)
|
return(sw1_t + sw2_t)
|
||||||
|
|
||||||
## ------------- BELL INVADERS START HERE ----------------
|
|
||||||
|
|
||||||
#global variables. Sue me.
|
#global variables. Sue me.
|
||||||
game_score = 0
|
game_score = 0
|
||||||
@@ -336,8 +334,7 @@ while game_is_not_over_yet:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
for alien in Alien.get_all_active():
|
for alien in Alien.get_all_active():
|
||||||
alien.x += alien_step_direction
|
alien.x += alien_step_direction
|
||||||
|
|
||||||
|
|
||||||
for alien in Alien.get_all_active():
|
for alien in Alien.get_all_active():
|
||||||
alien.update()
|
alien.update()
|
||||||
@@ -380,14 +377,9 @@ while game_is_not_over_yet:
|
|||||||
|
|
||||||
# Hit detection bomb to player
|
# Hit detection bomb to player
|
||||||
if bomb.y>60 and bomb.x > tank_x-3 and bomb.x < tank_x + 2:
|
if bomb.y>60 and bomb.x > tank_x-3 and bomb.x < tank_x + 2:
|
||||||
game_is_not_over_yet = False
|
game_is_not_over_yet = False
|
||||||
|
|
||||||
oled.fill_rect(bomb.x, bomb.y, 2, 3, 1)
|
oled.fill_rect(bomb.x, bomb.y, 2, 3, 1)
|
||||||
|
|
||||||
|
|
||||||
# debug info
|
|
||||||
#debugvalue = game_score
|
|
||||||
#oled.text(str(debugvalue), 4, 50)
|
|
||||||
|
|
||||||
oled.show()
|
oled.show()
|
||||||
|
|
||||||
@@ -402,4 +394,4 @@ oled.fill_rect(20, 12, 88, 36, 0)
|
|||||||
oled.rect(19, 11, 90, 38, 1)
|
oled.rect(19, 11, 90, 38, 1)
|
||||||
oled.text("GAME OVER", 25, 17, 1)
|
oled.text("GAME OVER", 25, 17, 1)
|
||||||
oled.text(str(game_score) + "pts", 25, 32, 1)
|
oled.text(str(game_score) + "pts", 25, 32, 1)
|
||||||
oled.show()
|
oled.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user