Bullet.gd 316 B

123456789101112131415161718
  1. extends Node2D
  2. var SPEED = 500
  3. var Velocity = Vector2();
  4. func _physics_process(delta):
  5. if SPEED < 0:
  6. $Plasma/Bullet.flip_h = true
  7. Velocity.x = SPEED * delta
  8. translate(Velocity)
  9. func _on_VisibilityNotifier2D_screen_exited():
  10. queue_free()
  11. func _on_Plasma_body_entered(body):
  12. if "dummy" in body.name:
  13. pass