ladybug932 change with the sprite given and change the background to blue too def…
Jump to turn (7)
- 1ladybug932 change with the sprite given and change the background to blue too de
- 2indented right
- 3bad input on lines
- 4name 'ladybugb12d' is not defined on line: 9
- 5def setstage(): """ Returns two ladybugs and the stop button """ stage.setbackgr
- 6Naming Conventions for Computer Science moving forward. I am not telling you wha
- 7can you do it with the code i gave you?
- User
lady_bug_932
change with the sprite given and change the background to blue too def set_stage(): """ Returns two mice and the stop button """ stage.set_background_color("black") mouseb = codesters.Sprite("mouseb_b6a") mousea = codesters.Sprite("mousea_e58") stop = codesters.Sprite("stopbutton_9f0", -150, -200) stop.set_size(.3) text1 = codesters.Text("Stop",-150,-200) return mousea, mouseb, stop def x_ray(sprite1, sprite2): """ Performs x-ray animation for both sprites """ sprite1.show() stage.wait(.5) sprite1.hide() stage.wait(.5) sprite1.show() def mice_move(sprite1,sprite2): """ Moves the mice """ sprite2.show() sprite1.set_y_speed(5) sprite2.set_y_speed(5) stage.wait(1) sprite1.set_y_speed(0) sprite2.set_y_speed(0) def eat_cheese(sprite1,sprite2): """ Makes cheese the mice can eat """ x = sprite1.get_x() y = sprite1.get_y() sprite3 = codesters.Sprite("cheese_c15",x-30,y+50) sprite3.set_size(.2) stage.wait(2) sprite1.hide() stage.remove_sprite(sprite3) sprite2.turn_left(360) sprite1.show() def main(): """ Sets up the program and calls other functions """ global running running = True sprite1, sprite2, button = set_stage() def click(sprite): global running running = False button.event_click(click) while running: x_ray(sprite1, sprite2) x_ray(sprite1, sprite2) mice_move(sprite1, sprite2) eat_cheese(sprite1, sprite2) main()