21e927966d
- Biom implementation - Better Graphics - again icon fix
18 lines
420 B
GDScript
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()
|