diff options
Diffstat (limited to 'Player.gd')
-rw-r--r-- | Player.gd | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Player.gd b/Player.gd new file mode 100644 index 0000000..df31a9e --- /dev/null +++ b/Player.gd @@ -0,0 +1,19 @@ +extends RigidBody2D + +@export var particle : PackedScene + +# Called when the node enters the scene tree for the first time. +func _ready(): + position = Vector2(randf_range(100, 1180), randf_range(100, 620)) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func destroy(): + var new = particle.instantiate() + new.position = global_position + new.emitting = true + get_tree().get_root().get_node("Prototype").add_child(new) + queue_free() |