diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-07-19 14:24:09 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-07-19 14:24:09 +0200 |
commit | 294f87adb4441ec25316601505ca1a7e97fa24c7 (patch) | |
tree | e48ed54e97f19ae5dd189ee42ddb73c4e995175f /Scenes/Entities/Enemies/Snake.gd | |
parent | 06647b11ee163bc40daf454d87e1fcae563c3ced (diff) |
update
Diffstat (limited to 'Scenes/Entities/Enemies/Snake.gd')
-rw-r--r-- | Scenes/Entities/Enemies/Snake.gd | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Scenes/Entities/Enemies/Snake.gd b/Scenes/Entities/Enemies/Snake.gd index a87ecf0..af09990 100644 --- a/Scenes/Entities/Enemies/Snake.gd +++ b/Scenes/Entities/Enemies/Snake.gd @@ -1,7 +1,7 @@ extends CharacterBody2D -@export var speed: float = 10 +@export var speed: float = 1 static var detected_bombs = [] var did_detect_bomb = false @@ -32,7 +32,9 @@ func _ready(): add_to_group("enemies") component_collision.init() + component_movement.SPEED = speed + component_movement.init() func _physics_process(delta): @@ -71,18 +73,19 @@ func _physics_process(delta): if $DetectionArea.get_overlapping_bodies().has(detected_bomb): _on_detection_area_body_entered(detected_bomb) elif did_detect_bomb: - component_movement.CURRENT_DIRECTION = detected_bomb_direction + component_movement.FIXED_DIRECTION = detected_bomb_direction - if not is_animating_state: - component_movement.physics_process(delta) + #if not is_animating_state: + #component_movement.physics_process(delta) func set_animating_state(state: bool): is_animating_state = state if is_animating_state: - component_movement.MovementTimer.stop() + component_movement.pause() + component_movement.FIXED_DIRECTION = null else: - component_movement.MovementTimer.start() + component_movement.unpause() func _on_detection_area_body_entered(_body): |