DuckRun/scenes/hindernis/hindernis.gd
megamichi 21e927966d - fixing hindernis speed
- Biom implementation
- Better Graphics
- again icon fix
2024-10-21 21:22:40 +02:00

18 lines
420 B
GDScript

extends CharacterBody2D
@onready var speed = 0
func _ready() -> void:
if $"/root/Global".active_biom == "w":
$"Sprite".frame = randi_range(5,9)
if $"/root/Global".active_biom == "s":
$"Sprite".frame = randi_range(10,12)
else:
$"Sprite".frame = randi_range(0,4)
func _process(delta: float) -> void:
speed = $"/root/Global".speed
global_position.x -= speed*delta
if global_position.x < -30:
queue_free()