Stats tracking updated. Work on skull storms. Enemy death sound added for goblins. Various updates and fixes.
This commit is contained in:
@@ -3,8 +3,9 @@ from src.object import Object
|
||||
from src.powerup import PowerUp
|
||||
import random
|
||||
|
||||
|
||||
class CoffinObject(Object):
|
||||
def __init__(self, x, y, sounds):
|
||||
def __init__(self, x, y, sounds, level):
|
||||
super().__init__(
|
||||
x, y, "coffin",
|
||||
isStatic=True,
|
||||
@@ -12,6 +13,7 @@ class CoffinObject(Object):
|
||||
isHazard=False
|
||||
)
|
||||
self.sounds = sounds
|
||||
self.level = level # Store level reference
|
||||
self.is_broken = False
|
||||
self.dropped_item = None
|
||||
|
||||
@@ -20,6 +22,8 @@ class CoffinObject(Object):
|
||||
if not self.is_broken:
|
||||
self.is_broken = True
|
||||
self.sounds['coffin_shatter'].play()
|
||||
self.level.player.stats.update_stat('Coffins broken', 1)
|
||||
self.level.player.stats.update_stat('Coffins remaining', -1)
|
||||
|
||||
# Stop the ongoing coffin sound
|
||||
if self.channel:
|
||||
|
Reference in New Issue
Block a user