From 1b94a2d094ea3a0db0bf4bfc72dad5f968c67a37 Mon Sep 17 00:00:00 2001 From: Roman Gräf Date: Tue, 21 Apr 2020 00:47:44 +0200 Subject: LAWSUITS! --- lawsuit/wright.gd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lawsuit/wright.gd (limited to 'lawsuit/wright.gd') diff --git a/lawsuit/wright.gd b/lawsuit/wright.gd new file mode 100644 index 0000000..42a53ce --- /dev/null +++ b/lawsuit/wright.gd @@ -0,0 +1,14 @@ +extends Node2D +var blueprint = preload("res://lawsuit/objection.tscn") +onready var speed = rand_range(80, 200) +func _physics_process(delta): + position += Vector2(speed, 0) * delta + if position.x > 1024: + get_parent().win() + + +func _on_Area2D_area_shape_entered(area_id, area, area_shape, self_shape): + queue_free() + var objection = blueprint.instance() + objection.position = position + get_parent().add_child(objection) -- cgit