From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Fri, 8 Jul 2022 14:39:28 +0000 (-0400) Subject: Updated combat X-Git-Url: http://git.skullheadx.com/nixos/static/gitweb.js?a=commitdiff_plain;h=4d58a3128fbe68308737601cc4576a3ddc81d0d9;p=Pygame-Jam.git Updated combat --- diff --git a/Actors.py b/Actors.py index 16979bb..6913cba 100644 --- 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): diff --git a/Enemy.py b/Enemy.py index a969d54..0a14e33 100644 --- 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 76a7432..5293288 100644 --- 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"])]