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