mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-10 06:05:20 -06:00
Mobs now takes an x, y location and places the sprite there.
This commit is contained in:
@@ -12,11 +12,14 @@ class Mob(object):
|
||||
"""
|
||||
Represents a Mob. No defined behaviour, it has no intelligence.
|
||||
"""
|
||||
def __init__(self, sprite, max_health=100, max_armor=0) -> None:
|
||||
def __init__(self, sprite, x, y, max_health=100, max_armor=0) -> None:
|
||||
self.sprite_path = sprite
|
||||
self.sprite = arcade.Sprite(self.sprite_path, Config.CHARACTER_SCALING)
|
||||
self.max_health, self.max_armor = max_health, max_armor
|
||||
self.health, self.armor = max_health, max_armor
|
||||
self.sprite.scale = 4
|
||||
self.sprite.center_x = x
|
||||
self.sprite.center_y = y
|
||||
|
||||
def tick(self) -> None:
|
||||
"""
|
||||
@@ -56,6 +59,9 @@ class Enemy(Mob):
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super(Enemy, self).__init__(*args, **kwargs)
|
||||
|
||||
def get_enemy(self):
|
||||
return self.sprite
|
||||
|
||||
def tick(self) -> None:
|
||||
"""
|
||||
A on_update function, the Enemy Mob should scan for the player, decide how to path to it, and
|
||||
|
||||
Reference in New Issue
Block a user