mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-12-28 09:47:16 +01:00
16cc3efb43
Fixes #45
16 lines
377 B
GDScript
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)
|