blob: a577d3368bc8becf03e12993fdf5f6867f209425 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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 queue_free():
print('p')
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)
|