godot-steering-ai-framework/project/demos/PursueSeek/BoundaryManager.gd
Nathan Lovato 68b85bb234 Format the code using gdformat
gdformat follows the official style guide, and handles line length and wrapping
lines for us.
2020-02-14 10:35:18 -06:00

16 lines
377 B
GDScript

extends Node2D
# Wraps the ships' positions around the world border.
var _world_bounds: Vector2
func _ready() -> void:
_world_bounds = Vector2(
ProjectSettings["display/window/size/width"], ProjectSettings["display/window/size/height"]
)
func _physics_process(_delta: float) -> void:
for ship in get_children():
ship.position = ship.position.posmodv(_world_bounds)