Beispiel #1
0
    def __init__(self):
        Scene.__init__(self)
        self.paused = False
        self.Character = CharacterController(Character(), self.CHARACTER_GROUP)
        self.TestMap = Map()

        Scene.add(self, 'CharacterController', self.Character)
        Scene.add(self, 'TestMap', self.TestMap)

        pass
    def __init__(self):
        Scene.__init__(self)
        self.next = None
        self.music = "assets/music/Phillip_Gross_-_02_-_Neon_Twin.mp3"
        self.background_1 = load_image("assets/images/scenes/background_credits.png")

        self.buttons = [
            ButtonPlay(lambda: self.assign_next_scene("main_menu"))
        ]


        self.mouse_state = 1 # Up
    def __init__(self, data, level):
        Scene.__init__(self)
        self.level = level
        self.music = "assets/music/{}".format(data["music"])
        self.sound_time_over = load_sound("assets/sounds/time_over.wav")
        self.sound_game_over = load_sound("assets/sounds/game_over.wav")
        self.sound_level_completed = load_sound("assets/sounds/level_completed.wav")
        self.background = load_image("assets/images/scenes/{}".format(data["background"]))

        # Things
        self.good_objets_data = data["good_objets"] # List of tuples (object, probability 0-1, needs)
        self.good_objets = []
        for ii in range(len(self.good_objets_data)):
            self.good_objets.append(self.good_objets_data[ii][0](ICON_LOCATIONS[ii]))
        self.bad_objects = data["bad_objets"]
        self.new_object_probability = data["new_object_probability"]
        self.probabilities = [self.good_objets_data[0][1] * self.new_object_probability]
        for ii in range(1, len(self.good_objets_data)):
            self.probabilities.append(self.probabilities[ii-1] + (self.good_objets_data[ii][1] * self.new_object_probability))

        # Variables
        self.things = pygame.sprite.Group()
        self.level_time = self.countdown = data["level_time"] * 1000
        self.start = False
        self.end_completed = False
        self.end_failed_time = False
        self.end_failed_health = False
        self.mouse_state = 1 # Up

        #Characters
        self.player = Player("keyboard", int(WIDTH / 2), GROUND_LEVEL)

        # Buttons
        ## Start level button
        self.start_level_button = load_image("assets/images/buttons/start_level_button.png")
        self.start_level_button_rect = self.start_level_button.get_rect()
        self.start_level_button_rect.center = START_FINISH_BUTTON

        ## Next level button
        self.next_level_button = load_image("assets/images/buttons/next_level_button.png")
        self.next_level_button_rect = self.next_level_button.get_rect()
        self.next_level_button_rect.center = START_FINISH_BUTTON

        ## Time over button
        self.time_over_button = load_image("assets/images/buttons/time_over_button.png")
        self.time_over_button_rect = self.time_over_button.get_rect()
        self.time_over_button_rect.center = START_FINISH_BUTTON

        ## Dead button
        self.dead_button = load_image("assets/images/buttons/dead_button.png")
        self.dead_button_rect = self.dead_button.get_rect()
        self.dead_button_rect.center = START_FINISH_BUTTON
Beispiel #4
0
    def __init__(self):
        Scene.__init__(self)
        self.next = None
        self.music = "assets/music/Phillip_Gross_-_02_-_Neon_Twin.mp3"
        self.background_1 = load_image(
            "assets/images/scenes/background_tutorial.png")

        self.buttons = [
            ButtonClose(LOCATION_BUTTON_CLOSE,
                        lambda: self.assign_next_scene("main_menu"))
        ]

        self.mouse_state = 1  # Up
    def __init__(self):
        Scene.__init__(self)
        self.next = None
        self.music = "assets/music/Phillip_Gross_-_02_-_Neon_Twin.mp3"
        self.background_1 = load_image(
            "assets/images/scenes/background_menu_1.png")
        self.background_2 = load_image(
            "assets/images/scenes/background_menu_2.png")

        self.buttons = [
            ButtonPlay(lambda: self.assign_next_scene("intro")),
            ButtonCredits(lambda: self.assign_next_scene("credits")),
            ButtonTutorial(lambda: self.assign_next_scene("tutorial")),
        ]

        self.mouse_state = 1  # Up
Beispiel #6
0
    def __init__(self):
        Scene.__init__(self)
        self.next = None
        self.persiana_sube = True
        self.fade = False
        self.changing = False
        self.alpha = 255

        self.music = "assets/music/Phillip_Gross_-_02_-_Neon_Twin.mp3"
        self.background_persiana = load_image("assets/images/scenes/background_menu_2.png")
        self.rect_background_persiana = self.background_persiana.get_rect()

        self.background_blurry = load_image("assets/images/scenes/background_game_blurry.png")
        self.background_clear = load_image("assets/images/scenes/background_game_clear.png")

        self.buttons = [
            ButtonPlay(lambda: self.assign_next_scene())
        ]
        self.mouse_state = 1 # Up
    def __init__(self, level):
        Scene.__init__(self)
        self.level = level
        self.next = None
        self.music = "assets/music/Phillip_Gross_-_03_-_Optimistic_Bits.mp3"
        self.sound_notification = load_sound("assets/sounds/notification.wav")
        self.background = load_image("assets/images/scenes/background_chat.png")
        self.chat = []
        for i in range(6):
            self.chat.append(pygame.transform.scale(load_image("assets/images/scenes/{}-{}.png".format(level, i)), CHAT_SURFACE))
        self.current_chat = -1
        self.chat_rect = self.chat[0].get_rect()
        self.chat_rect.center = (int(WIDTH / 2) , int(HEIGHT / 2))

        # Next chat button
        self.next_chat_button = load_image("assets/images/buttons/next_chat_button.png")
        self.next_chat_button_rect = self.next_chat_button.get_rect()
        self.next_chat_button_rect.center = NEXT_CHAT_BUTTON

        self.mouse_state = 1 # Up