diff options
author | Henrique Alves <henriquelalves@gmail.com> | 2022-07-16 15:32:08 -0300 |
---|---|---|
committer | Henrique Alves <henriquelalves@gmail.com> | 2022-07-16 15:32:08 -0300 |
commit | 0a3148bc9dfc4b3ff20046b93832592ed5c6e7ae (patch) | |
tree | aa7c3ef68463138cb1eea8ba16a0f608be3783c9 /Scenes/MonsterRandCardinal.gd | |
parent | 093a70adfe922f22b07bbf3b02fa52774c989943 (diff) | |
download | gamejam-gmtk-2022-0a3148bc9dfc4b3ff20046b93832592ed5c6e7ae.tar.gz gamejam-gmtk-2022-0a3148bc9dfc4b3ff20046b93832592ed5c6e7ae.tar.bz2 gamejam-gmtk-2022-0a3148bc9dfc4b3ff20046b93832592ed5c6e7ae.zip |
Add health to enemies
Diffstat (limited to 'Scenes/MonsterRandCardinal.gd')
-rw-r--r-- | Scenes/MonsterRandCardinal.gd | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Scenes/MonsterRandCardinal.gd b/Scenes/MonsterRandCardinal.gd index 8689b51..0fdabb1 100644 --- a/Scenes/MonsterRandCardinal.gd +++ b/Scenes/MonsterRandCardinal.gd @@ -2,28 +2,25 @@ extends Monster onready var cardinal = Vector2.UP onready var moved = false -onready var wait = -1 +onready var wait = 0 func _ready(): ._ready() if randf() < 0.5: cardinal = Vector2.RIGHT - if randf() < 0.5: - wait = 0 func get_weakness(): return ['2','4','6'] func try_moving(player_pos : Vector2, monster_pos : Vector2) -> MonsterAction: var action = MonsterAction.new() - - if wait != -1: - if wait == 0: - wait = 1 - action.type = MonsterActionType.IDLE - return action - else: - wait = 0 + + if wait == 0: + wait = 1 + action.type = MonsterActionType.IDLE + return action + else: + wait = 0 var next_movement = cardinal if moved: |