This commit is contained in:
Tabby 2025-06-30 20:47:54 +10:00
parent 1dadffeac4
commit ab1797b9ed
6 changed files with 120 additions and 61 deletions

View file

@ -5,10 +5,10 @@ extends RigidBody2D
@export var label : Label
@export var wind_speed_label : Label
@export var line : Line2D
var wind_speed : float = 30
var wind_speed : float = 0.1
#var move_speed : float = 20
var wind_acceleration : float = 0.2
var wind_change : float = 0.2
var wind_acceleration : float = 5
var wind_change : float = 5
var wind_penalty : float = 0
var sprite_spin : float = 40
@ -16,16 +16,19 @@ var move_acceleration : Vector2 = Vector2(0,0)
var move_change : Vector2 = Vector2(0,0)
var velocity : Vector2 = Vector2(0,0)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
label.text = get_category()
sprite.self_modulate = Color(1,1,1, clamp(wind_speed/20,0,1) )
wind_speed_label.text = str(round(wind_speed*10)/10)
wind_speed_label.text = str(round(wind_speed*10)/10) + "km/h"
sprite.rotation_degrees += sprite_spin * delta
if wind_speed <= 0:
end_cyclone()
@ -81,6 +84,7 @@ func get_category() -> String:
return "TD"
func _on_timer_timeout() -> void:
do_something()