12 lines
363 B
GDScript
12 lines
363 B
GDScript
extends Node2D
|
|
|
|
@export var float_str = 10.0
|
|
@export var float_time = 2.0
|
|
@export var float_offset = -12.0
|
|
var time = 0
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
time += delta
|
|
# Calculate the new Y position using a sine wave
|
|
position.y = sin(time * float_time) * float_str + float_offset
|