Added first setup of level-based system
This commit is contained in:
18
floating_element.gd
Normal file
18
floating_element.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
class_name FloatingElement extends MarginContainer
|
||||
|
||||
var dest: Vector2 = Vector2.ZERO
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var acceleration: float = 3.0
|
||||
var max_speed: float = 30.0
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
#var direction: Vector2 = (dest - position).normalized()
|
||||
#velocity += direction * acceleration
|
||||
#velocity = velocity.limit_length(max_speed)
|
||||
#position += velocity * delta
|
||||
position = position.lerp(dest, 15.0 * delta)
|
||||
|
||||
|
||||
func set_text(text: String) -> void:
|
||||
$Label.text = text
|
||||
Reference in New Issue
Block a user