diff --git a/triple-dungeon/config.py b/triple-dungeon/config.py index 2342919..db74317 100644 --- a/triple-dungeon/config.py +++ b/triple-dungeon/config.py @@ -38,10 +38,11 @@ class Config(object): PLAYER_MOVEMENT_SPEED = 14 MONSTER_MOVEMENT_SPEED = 11 - # Boon constants - BOON_LIST = ["heal", "harden"] + # Boon and Recipe constants + BOON_LIST = ["heal", "harden", "hurry"] HEAL_AMOUNT = 20 ARMOR_AMOUNT = 1 + SPEED_AMOUNT = 2 # How many pixels to keep as a minimum margin between the characters and the edge of the screen. LEFT_VIEWPORT_MARGIN = 700 diff --git a/triple-dungeon/main.py b/triple-dungeon/main.py index 8a05bde..a7d9249 100644 --- a/triple-dungeon/main.py +++ b/triple-dungeon/main.py @@ -109,6 +109,7 @@ class Game(arcade.Window): # Draw stats arcade.draw_text("Health:"+str(self.player.health)+"/"+str(self.player.max_health), self.view_left+100, self.view_bottom+60, arcade.color.RED, 15, font_name='Arial') arcade.draw_text("Armor:"+str(self.player.armor), self.view_left+100, self.view_bottom+90, arcade.color.BLUE, 15, font_name='Arial') + arcade.draw_text("Speed:"+str(self.player.speed), self.view_left+100, self.view_bottom+120, arcade.color.YELLOW, 15, font_name='Arial') if Config.DEBUG: x, y = self.player.position @@ -152,16 +153,16 @@ class Game(arcade.Window): """Called whenever a key is pressed. """ if key == arcade.key.UP or key == arcade.key.W: - self.player.change_y = Config.PLAYER_MOVEMENT_SPEED + self.player.change_y = self.player.speed self.prev_keypress.append(key) elif key == arcade.key.DOWN or key == arcade.key.S: - self.player.change_y = -Config.PLAYER_MOVEMENT_SPEED + self.player.change_y = -self.player.speed self.prev_keypress.append(key) elif key == arcade.key.LEFT or key == arcade.key.A: - self.player.change_x = -Config.PLAYER_MOVEMENT_SPEED + self.player.change_x = -self.player.speed self.prev_keypress.append(key) elif key == arcade.key.RIGHT or key == arcade.key.D: - self.player.change_x = Config.PLAYER_MOVEMENT_SPEED + self.player.change_x = self.player.speed self.prev_keypress.append(key) elif key == 65307: self.close() diff --git a/triple-dungeon/mobs.py b/triple-dungeon/mobs.py index e32b374..1f7e934 100644 --- a/triple-dungeon/mobs.py +++ b/triple-dungeon/mobs.py @@ -183,10 +183,13 @@ class Player(Mob): def heal(self): self.health+=Config.HEAL_AMOUNT - + def harden(self): self.armor+=Config.ARMOR_AMOUNT + def hurry(self): + self.speed+=Config.SPEED_AMOUNT + def update_animation(self, delta_time: float = 1 / 60) -> None: """ Updates animations for the Player. diff --git a/triple-dungeon/recipe.py b/triple-dungeon/recipe.py index 7f28ea5..a4381d4 100644 --- a/triple-dungeon/recipe.py +++ b/triple-dungeon/recipe.py @@ -24,7 +24,7 @@ class ActiveRecipe(arcade.SpriteList): def __init__(self): super().__init__() self.active = Recipe.GHOSTS - self.cycle_recipes = [self.set_frogs, self.set_ghosts] + self.cycle_recipes = [self.set_ghosts, self.set_frogs, self.set_ggf] self.pos = 0 self.kill_num = 0 @@ -42,10 +42,10 @@ class ActiveRecipe(arcade.SpriteList): sprite.draw() def next_recipe(self): - self.cycle_recipes[self.pos]() self.pos += 1 if self.pos == len(self.cycle_recipes): self.pos = 0 + self.cycle_recipes[self.pos]() def add_kill(self, monster_type) -> int: for sprite in self.sprite_list: @@ -70,4 +70,11 @@ class ActiveRecipe(arcade.SpriteList): self.sprite_list = [] self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/frog/frog1.png")) self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/frog/frog1.png")) - self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/frog/frog1.png")) \ No newline at end of file + self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/frog/frog1.png")) + + def set_ggf(self) -> None: + self.active = Recipe.GHOST_FROG + self.sprite_list = [] + self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/frog/frog1.png")) + self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/ghost/ghost1.png")) + self.sprite_list.append(arcade.Sprite(filename="resources/images/monsters/ghost/ghost1.png")) \ No newline at end of file