Code cleanup, added more functionality. Floating coffins that spawn items, graves can spawn zombies, etc.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from libstormgames import *
|
||||
|
||||
class Object:
|
||||
def __init__(self, x, yPos, soundName, isStatic=True, isCollectible=False, isHazard=False):
|
||||
def __init__(self, x, yPos, soundName, isStatic=True, isCollectible=False, isHazard=False, zombie_spawn_chance=0):
|
||||
# x can be either a single position or a range [start, end]
|
||||
self.xRange = [x, x] if isinstance(x, (int, float)) else x
|
||||
self.yPos = yPos
|
||||
@@ -9,6 +9,8 @@ class Object:
|
||||
self.isStatic = isStatic
|
||||
self.isCollectible = isCollectible
|
||||
self.isHazard = isHazard
|
||||
self.zombie_spawn_chance = zombie_spawn_chance
|
||||
self.has_spawned = False # Track if this object has spawned a zombie
|
||||
self.channel = None # For tracking the sound channel
|
||||
self.isActive = True
|
||||
# For collectibles in a range, track which positions have been collected
|
||||
|
Reference in New Issue
Block a user