DuckRun/scenes/hurdle/hurdle.gd
megamichi dd5b4bcae5 - improving textures
- adding coins (no shop jet)
- adding skin changing [no gui jet
- fixing loops for deleting stuff]
2024-11-10 19:51:00 +01:00

17 lines
403 B
GDScript

extends CharacterBody2D
@onready var speed = 0
func _ready() -> void:
$"Sprite".frame_coords.x = randi_range(0,4)
if $"/root/Global".active_biom == "w":
$"Sprite".frame_coords.y = 1
elif $"/root/Global".active_biom == "s":
$"Sprite".frame_coords.y = 2
else:
$"Sprite".frame_coords.y = 0
func _process(delta: float) -> void:
speed = $"/root/Global".speed
global_position.x -= speed*delta