15 lines
479 B
GDScript
15 lines
479 B
GDScript
extends Node2D
|
|
|
|
const WORLD_SIZE := Vector2(5200.0, 3600.0)
|
|
|
|
@onready var player: CharacterBody2D = $PlayerShip
|
|
|
|
func _ready() -> void:
|
|
# Keep the camera limits aligned with the test map if its size is tuned later.
|
|
var camera := player.get_node_or_null("Camera2D") as Camera2D
|
|
if camera:
|
|
camera.limit_left = int(-WORLD_SIZE.x * 0.5)
|
|
camera.limit_right = int(WORLD_SIZE.x * 0.5)
|
|
camera.limit_top = int(-WORLD_SIZE.y * 0.5)
|
|
camera.limit_bottom = int(WORLD_SIZE.y * 0.5)
|