diff options
Diffstat (limited to 'lawsuit/wright.gd')
-rw-r--r-- | lawsuit/wright.gd | 14 |
1 files changed, 14 insertions, 0 deletions
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) |