]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
Updated combat
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 8 Jul 2022 14:39:28 +0000 (10:39 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 8 Jul 2022 14:39:28 +0000 (10:39 -0400)
Actors.py
Enemy.py
Game.py

index 16979bb859e2d69e6edea1fa8e76ce469b4cf215..6913cbaeba55af668293ad25b87172b27b7b963e 100644 (file)
--- a/Actors.py
+++ b/Actors.py
@@ -94,10 +94,10 @@ class Actor:
         # if enemy.velocity.x != pg.Vector2(0,0):
         #     v = enemy.velocity.normalize().x
 
-        self.velocity += pg.Vector2(0.5 * v, -1)
+        self.velocity += pg.Vector2(0.75 * v, -1)
 
     def push2(self, direction):
-        self.velocity += pg.Vector2(0.5 * direction, -1)
+        self.velocity += pg.Vector2(0.75 * direction, -1)
 
 
     def move_and_collide(self, pos, vel, delta):
index a969d54e5bbfc7f9aafee3bc525f5e1568c2e0f3..0a14e3346abb52e9247d786030a55f47fb8c0dfa 100644 (file)
--- a/Enemy.py
+++ b/Enemy.py
@@ -27,8 +27,8 @@ class Enemy(Actor):
     def update(self, delta, target=None):
         super().update(delta)
         if target is not None and self.dizzy_time == 0:
-            self.follow_target(target,stop_dist=self.weapon.width * 0.8 + self.width + target.width)
-            if random.random() < 3/fps and not self.weapon.attacking and self.weapon.get_collision_rect().colliderect(target.get_collision_rect()):
+            self.follow_target(target,stop_dist=self.weapon.width * 0.99)
+            if random.random() < 4.5/fps and not self.weapon.attacking and self.weapon.get_collision_rect().colliderect(target.get_collision_rect()):
                 self.weapon.swing()
                 target.attack(self, self.weapon)
         self.dizzy_time -= delta
diff --git a/Game.py b/Game.py
index 76a74323aaa50b6503b6891120f30ad6469f4e2c..52932886026774531c61bdda6e0078a90764b7c3 100644 (file)
--- a/Game.py
+++ b/Game.py
@@ -19,7 +19,7 @@ class Game:
                              [self.collision_layer["enemy"]])
         # self.pet = Pet(center, self.collision_layer["pet"], [self.collision_layer["world"]])
 
-        self.enemies = [Enemy((SCREEN_WIDTH / 4, SCREEN_HEIGHT / 2), self.collision_layer["enemy"],
+        self.enemies = [Enemy((SCREEN_WIDTH *3/ 4, SCREEN_HEIGHT / 2), self.collision_layer["enemy"],
                               [self.collision_layer["player"], self.collision_layer["world"]])]
         self.blocks = [Block((-0, SCREEN_HEIGHT * 3 / 4), self.collision_layer["world"])]