2024-10-01 15:56:30 +02:00
|
|
|
extends CharacterBody2D
|
|
|
|
|
|
|
|
@onready var speed = 0
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2024-10-22 19:52:35 +02:00
|
|
|
$"Sprite".frame_coords.x = randi_range(0,4)
|
2024-10-21 21:22:40 +02:00
|
|
|
if $"/root/Global".active_biom == "w":
|
2024-10-22 19:52:35 +02:00
|
|
|
$"Sprite".frame_coords.y = 1
|
|
|
|
elif $"/root/Global".active_biom == "s":
|
|
|
|
$"Sprite".frame_coords.y = 2
|
2024-10-21 21:22:40 +02:00
|
|
|
else:
|
2024-10-22 19:52:35 +02:00
|
|
|
$"Sprite".frame_coords.y = 0
|
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
|