27 lines
450 B
GDScript3
27 lines
450 B
GDScript3
|
|
extends Area2D
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
var speed = 200
|
||
|
|
|
||
|
|
func _ready():
|
||
|
|
$pickup_despawn.start()
|
||
|
|
#print("ready started")
|
||
|
|
|
||
|
|
func _physics_process(delta):
|
||
|
|
global_position.y += speed * delta
|
||
|
|
#asset clean up
|
||
|
|
if global_position.y > 980:
|
||
|
|
queue_free()
|
||
|
|
|
||
|
|
|
||
|
|
func _on_area_entered(area):
|
||
|
|
if area is player:
|
||
|
|
get_tree().current_scene.missile_container()
|
||
|
|
queue_free()
|
||
|
|
|
||
|
|
#timer might be redundant, remove later
|
||
|
|
func _on_pickup_despawn_timeout():
|
||
|
|
print("time out")
|
||
|
|
queue_free()
|