Compare commits

...

2 Commits

Author SHA1 Message Date
Luna Brovchuk ece77430a7 Merge branch 'main' of http://meowo.cc:3000/meowo/LD54 2023-10-01 17:29:02 +02:00
Luna Brovchuk b507c62425 Add Delay After Ghost's Dash 2023-10-01 17:28:57 +02:00
2 changed files with 9 additions and 1 deletions

View File

@ -25,7 +25,6 @@ flip_h = true
use_parent_material = true
frames = ExtResource( 1 )
animation = "idle"
frame = 2
playing = true
centered = false

View File

@ -2,6 +2,8 @@ extends EnemyClass
onready var player = $"../../Player"
var dash_target = Vector2.ZERO
var afterdash_timer = .0
var afterdash = false
var dash_timer = .0
var dashing = false
@ -33,4 +35,11 @@ func _physics_process(delta):
global_position = global_position.move_toward(dash_target, 10)
if global_position == dash_target:
dashing = false
afterdash = true
if afterdash:
afterdash_timer += delta
if afterdash_timer >= 1:
afterdash = false
afterdash_timer = .0
dash_target = Vector2.ZERO