20 lines
313 B
GDScript3
20 lines
313 B
GDScript3
|
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
|
||
|
|
||
|
|
||
|
func screen_e() -> void:
|
||
|
screen_entered.emit()
|
||
|
|
||
|
func screen_exited() -> void:
|
||
|
queue_free()
|