DuckRun/scenes/ground/ground.gd
megamichi 45193fc27f - adding coins
- performance improvements
- shake effect
- keyboard support
2024-11-04 19:10:10 +01:00

21 lines
357 B
GDScript

extends Sprite2D
signal screen_entered
var speed: float
func _ready() -> void:
pass
func _physics_process(delta: float) -> void:
if $"/root/Global".gamerunning:
global_position.x -= $"/root/Global".speed*delta
if global_position.y < -30:
queue_free()
func screen_e() -> void:
screen_entered.emit()
func screen_exited() -> void:
queue_free()