feat: 1.添加统计面板, 2. 游戏暂停标志 Global.paused
This commit is contained in:
@@ -18,6 +18,9 @@ func _ready() -> void:
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if Global.game_paused:
|
||||
return
|
||||
|
||||
if not can_move:
|
||||
return
|
||||
|
||||
@@ -44,8 +47,6 @@ func get_move_direction() -> Vector2:
|
||||
|
||||
func update_rotate() -> void:
|
||||
|
||||
print("11111111")
|
||||
|
||||
if !is_instance_valid(Global.player):
|
||||
return
|
||||
|
||||
@@ -73,6 +74,11 @@ func reset_knockback() -> void:
|
||||
knockback_dir = Vector2.ZERO
|
||||
knockback_power = 0
|
||||
|
||||
func destroy_enemy() -> void:
|
||||
can_move = false
|
||||
anim_player.play("die")
|
||||
await anim_player.animation_finished
|
||||
queue_free()
|
||||
|
||||
func _on_knockback_timer_timeout() -> void:
|
||||
reset_knockback()
|
||||
|
||||
Reference in New Issue
Block a user