stage.set_background("underwater")
sprite = codesters.Sprite("fish1", 0, -220)
stage.set_gravity(4)
stage.disable_floor()
sprite.gravity_off()
score = 0
score_board = codesters.Display(score)
def interval():
x = random.randint(-260, 260)
food = codesters.Circle(x, 230, 10, "sienna")
# add any other actions...
stage.event_interval(interval, 2)
def left():
sprite.move_left(30)
# add other actions...
stage.event_left_key(left)
def right():
sprite.move_right(30)
# add other actions...
stage.event_right_key(right)
def collision(sprite, hit_sprite):
stage.remove_sprite(hit_sprite)
global score
score += 1
score_board.update(score)
sprite.turn_right(360)
sprite.set_say_color("red")
sprite.say("YUM!", 0.5)
# add any other actions...
sprite.event_collision(collision)
tester = TestManager()
tester.display_success_message("Great job!")