27 lines
529 B
GDScript3
27 lines
529 B
GDScript3
|
extends Area2D
|
||
|
var velocity: Vector2 = Vector2()
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
pass # Replace with function body.
|
||
|
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
pass
|
||
|
|
||
|
func _physics_process(delta):
|
||
|
position += velocity * delta
|
||
|
|
||
|
|
||
|
func _on_body_entered(body):
|
||
|
#if body.is_in_group("players"):
|
||
|
# Global.live = 2
|
||
|
#elif body.is_in_group("enemies"):
|
||
|
# Global.live = 3
|
||
|
queue_free()
|
||
|
|
||
|
|
||
|
func _on_screen_exited():
|
||
|
queue_free()
|