Skip to content

Commit

Permalink
Remove redundant comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jriyyya authored Oct 1, 2023
1 parent 4eb4063 commit ba76b93
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions math_hurdler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Color:

class MathHurdler:
def __init__(self):
# Set up a clock for managing the frame rate.
self.clock = pygame.time.Clock()

self.x = -100
Expand Down Expand Up @@ -163,7 +162,6 @@ def load_highscore(self):
return 0
return 0

# The main game loop.

def run(self):

Expand Down Expand Up @@ -288,7 +286,6 @@ def generate_question():

def set_answer(answer_index):
self.vx *= 2
# unselect the previous answer button
if self.last_answer_index >= 0:
self.buttons[self.last_answer_index].set_selected(False)

Expand Down Expand Up @@ -320,7 +317,6 @@ def evaluate_answer(answer):
Color.GREEN)

while self.running:
# Processing Gtk Events
while Gtk.events_pending():
Gtk.main_iteration()
if self.playing:
Expand Down Expand Up @@ -398,11 +394,9 @@ def evaluate_answer(answer):
question_dirty = False

if self.gameover:
# spin the horse
self.save_highscore()
horse.set_horse(Horse.DEAD)

# Set the "sky" color to blue
screen.fill(background_color)

sun.rect.topleft = (screen_size[0] - sun.image.get_width(), 0)
Expand Down Expand Up @@ -454,23 +448,20 @@ def evaluate_answer(answer):
)
)

# Draw the frame
pygame.display.flip()

if self.gameover:
pygame.time.delay(6000)
self.set_playing(False)
reset()

# Try to stay at 30 FPS
self.clock.tick(18)

else:
def start_game():
reset()
self.set_playing(True)

# in the menu
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
Expand All @@ -491,7 +482,6 @@ def start_game():

self.horse_change += 1

# draw rainbow background fill
screen.fill(
(
math.floor(
Expand All @@ -506,22 +496,19 @@ def start_game():
)
)

# draw menu horse
horse.rect.x = (screen_size[0] - horse.image.get_width()) // 2
horse.rect.y = (
screen_size[1] - horse.image.get_height()) // 2 + 200

menu_sprites = pygame.sprite.RenderPlain(horse)
menu_sprites.draw(screen)

# draw play button
play_button.rect.x = (
screen_size[0] - play_button.rect.width) // 2
play_button.rect.y = (
screen_size[1] - play_button.rect.height) // 2
play_button.draw(screen)

# draw menu label
screen.blit(
menu_label,
(
Expand All @@ -532,7 +519,6 @@ def start_game():

pygame.display.flip()

# Try to stay at 30 FPS
self.clock.tick(30)


Expand Down

0 comments on commit ba76b93

Please sign in to comment.