Extensive work on animations and partially functional level keys, new UI gears but needs rounding error correction. Particle preloader added.
This commit is contained in:
14
scripts/ui_gear.gd
Normal file
14
scripts/ui_gear.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Sprite2D
|
||||
@export var gradient : Gradient
|
||||
@export var teeth : int = 1
|
||||
@export var time_per_tooth : float = 5.0
|
||||
@export var clockwise : bool
|
||||
var step : float
|
||||
|
||||
func _ready() -> void:
|
||||
step = 2.0 * PI / (teeth * time_per_tooth)
|
||||
modulate = gradient.sample(randf())
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var angle = step * delta
|
||||
rotate(angle if clockwise else -angle)
|
||||
Reference in New Issue
Block a user