mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
17
Scripts/Classes/Components/AnimationPauser.gd
Normal file
17
Scripts/Classes/Components/AnimationPauser.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
class_name AnimationPauser
|
||||
extends Node
|
||||
|
||||
@export var animation_player: AnimationPlayer = null
|
||||
|
||||
@export var paused := false
|
||||
|
||||
signal just_paused
|
||||
signal resumed
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
animation_player.speed_scale = int(not paused)
|
||||
|
||||
func on_switch_hit() -> void:
|
||||
paused = not paused
|
||||
if paused: just_paused.emit()
|
||||
else: resumed.emit()
|
Reference in New Issue
Block a user