extends Stage func _ready() -> void: $Player.camera.limit_left = get_world_boundaries()[Vector2.LEFT] $Player.camera.limit_right = get_world_boundaries()[Vector2.RIGHT] $Player.camera.limit_top = get_world_boundaries()[Vector2.UP] $Player.camera.limit_bottom = get_world_boundaries()[Vector2.DOWN] $TileMapLayer.modulate = Color(max(0.1, randf()), max(0.1, randf()), max(0.1, randf())) set_mobile_controls() func get_world_boundaries() -> Dictionary: return { Vector2.LEFT: $TileMapLayer.get_used_rect().position.x * $TileMapLayer.tile_set.tile_size.x, Vector2.RIGHT: $TileMapLayer.get_used_rect().end.x * $TileMapLayer.tile_set.tile_size.x, Vector2.UP: $TileMapLayer.get_used_rect().position.y * $TileMapLayer.tile_set.tile_size.y - $HUD.size.y, Vector2.DOWN: $TileMapLayer.get_used_rect().end.y * $TileMapLayer.tile_set.tile_size.y, } func has_win_condition() -> bool: return %Opponents.get_child_count() == 0