mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2025-01-05 17:59:39 +01:00
1f44bace3e
- simplify code when possible - add a simple info panel - adhere to the "new" gdscript guidelines
18 lines
418 B
GDScript
18 lines
418 B
GDScript
extends Node2D
|
|
# Wraps the ships' positions around the world border, and controls their rendering clones.
|
|
|
|
|
|
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)
|