From 8530993fa9ae88f0240f7cd544a9aeb718f06060 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 11 Feb 2025 20:23:39 -0500 Subject: [PATCH] Fixed item crazy sound mismatch. Updated instructions, probably not final version, but at least a place holder. --- files/instructions.txt | 19 +++++++++++++++++-- src/level.py | 4 ++-- src/powerup.py | 27 ++++++++++++++++----------- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/files/instructions.txt b/files/instructions.txt index e873dd5..b9de348 100644 --- a/files/instructions.txt +++ b/files/instructions.txt @@ -17,28 +17,43 @@ Control: attack Space: hold to run. f: throw jack O'lantern c: check bone dust +e: Check currently wielded weapon. h check health j: check jack O'lanterns l: check lives remaining +Alt+PageDown: Master volume decrease +Alt+PageUp: Master volume increase +Alt+End: Ambience volume decrease +Alt+Home: Game volume increase +Alt+Delete: Game sounds volume decrease +Alt+Insert: Game sounds volume increase Notes -Each 5 bone dust restores 1 health. -Each 100 bone dust gains an extra unlife. +Coffins must be broken with your weapon. Jump and attack to shatter them. Just because you leave catapult range doesn't mean you are safe from already fired pumpkins. +Spider webs can be passed by ducking as you move by them. +Spider web affect lasts even after death. Your speed is reduced to half for 15 seconds. +Running and jumping both move you at 1.5 your normal speed. Enemies Goblin: Walks back and forth in his area trying to break your bones. Ghoul: Same behavior as goblin, but if you enter his area he will actively chase you, staying close. +Boogie man: A stronger goblin. +Witch: Like boogie man, but drops broom if you do not have one, else drops her cauldron. Pumpkin Catapult: Fires pumpkins at you in hopes of smashing you into bone dust. Skull Storm: Screaming skulls rain down causing damage if they hit you. +Spider: Very dangerous fast enemy. Zombie: Slow moving creatures that have a chance to climb out of the open grave. They are slow moving but deadly. If they hit you you lose a life. Bonuses and items Bone dust: Currency of the game. Collect it to gain health and extra lives. +Witch's broom: A weapon gained from witches. Stronger than the graver digger's rusty shovel. Coffin: Contains items. Be quick, they try to escape. Guts: Adds 2 health to your maximum unlife. Hand of Glory: Grants invincibility for a short time. Jack O'lantern: Throw these at your enemies to hit them from a distance. +Shin bone: Worth 5 bone dust. +Skeletal nunchucks: Only a rumer. If it exists, it probably has to be crafted by obtaining the correct items. It is said to be the most powerful weapon in the game. diff --git a/src/level.py b/src/level.py index d60e184..7c39c8f 100644 --- a/src/level.py +++ b/src/level.py @@ -231,14 +231,14 @@ class Level: # Update bouncing items for item in self.bouncing_items[:]: # Copy list to allow removal - if not item.update(currentTime): + if not item.update(currentTime, self.player.xPos): self.bouncing_items.remove(item) if not item.isActive: speak(f"{item.soundName} got away!") continue # Check for item collection - if abs(item.xPos - self.player.xPos) < 1 and self.player.isJumping: + if abs(item._currentX - self.player.xPos) < 1 and self.player.isJumping: play_sound(self.sounds[f'get_{item.soundName}']) item.apply_effect(self.player) item.isActive = False diff --git a/src/powerup.py b/src/powerup.py index 1c69f1b..77bcd25 100644 --- a/src/powerup.py +++ b/src/powerup.py @@ -12,33 +12,38 @@ class PowerUp(Object): ) self.sounds = sounds self.direction = direction - self.speed = 0.05 # Base movement speed + self.speed = 0.055 # Base movement speed self.item_type = item_type self.channel = None self._currentX = x # Initialize the current x position - def update(self, current_time): - """Update item position""" + def update(self, current_time, player_pos): + """Update item position + + Args: + current_time: Current game time in milliseconds + player_pos: Current player x position + """ if not self.isActive: return False - + # Update position self._currentX += self.direction * self.speed - + # Update positional audio if self.channel is None or not self.channel.get_busy(): - self.channel = obj_play(self.sounds, "item_bounce", self.xPos, self._currentX) + self.channel = obj_play(self.sounds, "item_bounce", player_pos, self._currentX) else: - self.channel = obj_update(self.channel, self.xPos, self._currentX) - - # Check if item has gone too far (20 tiles) - if abs(self._currentX - self.xRange[0]) > 20: + self.channel = obj_update(self.channel, player_pos, self._currentX) + + # Check if item has gone too far (12 tiles) + if abs(self._currentX - player_pos) > 12: self.isActive = False if self.channel: self.channel.stop() self.channel = None return False - + return True def apply_effect(self, player):