Added effects manager and two effects to test attached to the player
scene.
This commit is contained in:
parent
1200ac7e32
commit
b4c4a66ce8
19 changed files with 322 additions and 40 deletions
22
scripts/effects/base_effect.gd
Normal file
22
scripts/effects/base_effect.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class_name BaseEffect
|
||||
extends Resource
|
||||
|
||||
@export var duration: float = 0.5
|
||||
|
||||
var _elapsed: float = 0.0
|
||||
|
||||
# Called when the effect is applied
|
||||
func start(target: Node) -> void:
|
||||
_elapsed = 0.0
|
||||
|
||||
# Called every frame (if needed)
|
||||
func process(delta: float, target: Node) -> void:
|
||||
_elapsed += delta
|
||||
|
||||
# Clean up any changes to the target
|
||||
func stop(target: Node) -> void:
|
||||
pass
|
||||
|
||||
# Returns true when the effect has run its course
|
||||
func is_finished() -> bool:
|
||||
return _elapsed >= duration
|
||||
Loading…
Add table
Add a link
Reference in a new issue