2D multiplayer platformer using Godot Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
571 B

class_name Game
extends Node
static var INSTANCE : Game
static var NETWORK : Network
static var WORLD : World
static var PLAYERS : Node
static var LOCAL_PLAYER : Player
func _enter_tree() -> void:
INSTANCE = self
NETWORK = $Network
WORLD = $World
PLAYERS = $Players
LOCAL_PLAYER = $"Players/1"
func change_world(world: World) -> void:
remove_child(WORLD)
WORLD.queue_free()
world.name = "World"
add_child(world)
WORLD = world
LOCAL_PLAYER.chunk_loader.tracked_chunks.clear()
LOCAL_PLAYER.position = Vector2.ZERO