def start_level_2(): #character = MainCharacter() # Check the main character animation virus = Virus() # ... or check the virus animation. start_game(character=character, platforms=platforms, boxes=boxes, dis=disinfectants, gloves=gloves, inf_per=inf_pers, masks=masks, sinks=sinks, walls=floors, viruses=viruses, rects=platforms + boxes + floors, backgrounds=backgrounds)
def start_level_5(win, character, energy_time1, energy_time2): character.set_position(130, 570) virus = Virus() # ... or check the virus animation. return start_game(character=character, platforms=platforms, boxes=boxes, dis=disinfectants, gloves=gloves, inf_per=inf_pers, masks=masks, sinks=sinks, walls=floors, viruses=viruses, rects=platforms + boxes + floors, doors=doors, backgrounds=backgrounds, win=win, energy_time1=energy_time1, energy_time2=energy_time2, platformImages=platformImages)
player.set_image('images/link_up.png') result = player.set_y(player.y - 5) if result == "TOP": engine.set_background('images/bg-up.png') player.set_y(engine.height - player.height) def move_down(): player.set_image('images/link_down.png') result = player.set_y(player.y + 5) if result == "BOTTOM": engine.set_background('images/bg-down.png') player.set_y(0) def mouse_click(x, y): print(x, y) player = Player('images/link_down.png') player.draw_bbox() player.set_bbox(20, 0, 28, 10) engine.add_player(player) engine.on_mouse_click(mouse_click) engine.set_background('images/bg-start.png') engine.on_key_down(pygame.K_LEFT, move_left) engine.on_key_down(pygame.K_RIGHT, move_right) engine.on_key_down(pygame.K_UP, move_up) engine.on_key_down(pygame.K_DOWN, move_down) engine.start_game()