Fixed that lasers don't queue_free offscreen
This commit is contained in:
parent
eddcd6d388
commit
83c856d277
3
Laser.gd
3
Laser.gd
|
@ -54,6 +54,9 @@ func _process(delta):
|
||||||
velocity = velocity.normalized() * SPEED
|
velocity = velocity.normalized() * SPEED
|
||||||
position += velocity * delta
|
position += velocity * delta
|
||||||
|
|
||||||
|
if position.x > 2000:
|
||||||
|
queue_free()
|
||||||
|
|
||||||
func _on_Laser_body_entered(body):
|
func _on_Laser_body_entered(body):
|
||||||
emit_signal("hit")
|
emit_signal("hit")
|
||||||
if plasma == false:
|
if plasma == false:
|
||||||
|
|
|
@ -19,7 +19,7 @@ animations = [ {
|
||||||
"speed": 20.0
|
"speed": 20.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="Laser" type="Area2D"]
|
[node name="Laser" type="Area2D" index="0"]
|
||||||
|
|
||||||
input_pickable = true
|
input_pickable = true
|
||||||
gravity_vec = Vector2( 0, 1 )
|
gravity_vec = Vector2( 0, 1 )
|
||||||
|
|
Loading…
Reference in New Issue