]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
enemy health + win bug
authorSkullheadx <704277@pdsb.net>
Wed, 13 Jul 2022 18:10:52 +0000 (14:10 -0400)
committerSkullheadx <704277@pdsb.net>
Wed, 13 Jul 2022 18:10:52 +0000 (14:10 -0400)
Enemy.py
Game.py

index e8f605af6cd375a399c8cf74d586823cf6069555..c3d0fcc26045ec4ec2cd8ad99c0933d2bbd18141 100644 (file)
--- a/Enemy.py
+++ b/Enemy.py
@@ -148,7 +148,7 @@ class Skeleton(Actor):
         self.direction = -1
         self.prev_direction = self.direction
 
-        # self.health = 0 # for debugging without getting killed
+        self.health = 75 # for debugging without getting killed
 
         self.weapon = Sword(self.position, (0, 0), self.width, -1)
 
diff --git a/Game.py b/Game.py
index b09cbda235e556449b877ea3b1a0f9f052f82b9b..10f5ea94e4775ff96055b3813c5e1f1e8009637a 100644 (file)
--- a/Game.py
+++ b/Game.py
@@ -165,6 +165,8 @@ class Game:
                                                   self.collision_layer["body"],
                                                   [self.collision_layer["world"], self.collision_layer["body"]], goon_skin=False)
                     self.collision_layer["body"].add(self.king)
+                    for enemy in self.skeletons:
+                        enemy.dead = True
 
             for particle in particles:
                 particle.update(delta)
@@ -195,8 +197,8 @@ class Game:
         surf.blit(self.sky, (0, 0))
 
         if (self.level == 4):
-            print(get_camera_offset())
-            if self.king is not None:
+            print(get_camera_offset())
+            if self.king is not None and isinstance(self.king, King):
                 if self.king.skeleton_attack == True:
                     for i in range(random.randint(1, 2)):
                         if(len(self.skeleton_spawn_coords) < 2):