extends Node2D


export var can_pause = true
export var bottomless_pit = true

var paused = false

export var snow = false
export var rain = false
export var fog = false
export var lavaground = false


# Called when the node enters the scene tree for the first time.
func _ready():
	Game.can_pause = can_pause
	
	if has_node("Player"):
		Game.player = $Player
	
	if Game.effects: 
		Game.effects.fade_out_white(0.4)
	
	if has_node("Camera") and has_node("Player"):
		$Camera.target = $Player
	
	if get_tree().get_nodes_in_group("HideAtStart"):
		var objects = get_tree().get_nodes_in_group("HideAtStart")
		for object in objects:
			object.hide()	
		
	if not Game.effects: return
	
	if snow: Game.effects.start_snow()
	else:  Game.effects.stop_snow()
	
	if rain: Game.effects.start_rain()
	else:  Game.effects.stop_rain()
	
	if fog: Game.effects.start_lightfog()
	else:  Game.effects.stop_lightfog()
	
	if lavaground: Game.effects.start_lavaground()
	else:  Game.effects.stop_lavaground()
