# 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):
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
[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"])]