2024-10-01 15:56:30 +02:00
|
|
|
extends CharacterBody2D
|
|
|
|
|
|
|
|
@onready var speed = 0
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2024-10-21 21:22:40 +02:00
|
|
|
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)
|
2024-10-01 15:56:30 +02:00
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
2024-10-21 21:22:40 +02:00
|
|
|
speed = $"/root/Global".speed
|
2024-10-01 15:56:30 +02:00
|
|
|
global_position.x -= speed*delta
|
2024-10-18 16:34:51 +02:00
|
|
|
if global_position.x < -30:
|
|
|
|
queue_free()
|