Added hitstop manager
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
class_name CHitstopManager
|
||||
extends Node
|
||||
|
||||
|
||||
const NORMAL_TIME_SCALE = 1.0
|
||||
|
||||
|
||||
@export var hitstop_duration := 0.1
|
||||
@export var hitstop_time_scale := 0.0
|
||||
|
||||
|
||||
func hitstop() -> void:
|
||||
Engine.time_scale = hitstop_time_scale
|
||||
await get_tree().create_timer(hitstop_duration, true, true, true).timeout
|
||||
Engine.time_scale = NORMAL_TIME_SCALE
|
||||
@@ -0,0 +1 @@
|
||||
uid://ca6ix4nt5uxp3
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://ba262w3ebkyo1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ca6ix4nt5uxp3" path="res://game/managers/hitstop_manager.gd" id="1_n7h4l"]
|
||||
|
||||
[node name="HitstopManager" type="Node" unique_id=669581391]
|
||||
script = ExtResource("1_n7h4l")
|
||||
Reference in New Issue
Block a user