
- Got sprites for menu buttons - Added buttons to the menu - Added a manager script for the menu - Created resources for playlists and credits - Created a music player - Created the root scene that everything will be loaded into
40 lines
1.0 KiB
GDScript
40 lines
1.0 KiB
GDScript
extends GPUParticles2D
|
|
|
|
class_name ChargingAnim
|
|
|
|
@export var top: Vector2
|
|
@export var bottom: Vector2
|
|
|
|
@onready var effect: AnimatedSprite2D = $AnimatedSprite2D
|
|
|
|
var charging: bool = false
|
|
var timer: float = 1
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
if charging:
|
|
effect.position = lerp(bottom, top, timer)
|
|
else:
|
|
effect.position = lerp(top, bottom, timer)
|
|
timer = clampf(timer + delta, 0, 1)
|
|
|
|
func charge(strength: float, element: Data.Element) -> void:
|
|
charging = true
|
|
emitting = true
|
|
process_material.orbit_velocity_min = strength / 50
|
|
process_material.orbit_velocity_max = strength / 40
|
|
process_material.scale_min = strength / 5
|
|
process_material.scale_max = strength / 4
|
|
process_material.anim_speed_min = strength / 5
|
|
process_material.anim_speed_max = strength / 4
|
|
timer = 0
|
|
|
|
func disable() -> void:
|
|
charging = false
|
|
emitting = false
|
|
timer = 0
|