
extends Node2D

export var level_id = 0

var cursor_prefab = preload("res://scenes/cursor.scn")
var explosion_effect = preload("res://scenes/effects/explosion.scn")
var blood_splash_effect = preload("res://scenes/effects/blood_spalsh.scn")
var destroy_effect = preload("res://scenes/effects/destroy.scn")
var cursor
var hide_mouse = false

func _process(delta):
	cursor.set_pos(get_local_mouse_pos())
	update()

#func show_effect(var pos, var type, var mode):
#	var effect
#	if type == 1:
#		effect = explosion_effect.instance()
#	elif type == 2:
#		effect = blood_splash_effect.instance()
#	elif type == 3:
#		effect = destroy_effect.instance()
#	if mode == 2:
#		effect.mode = 2
#	effect.set_pos(pos)
#	add_child(effect)
#	
#func show_screen_effect(var effect, var state):
#	if state:
#		get_node("ui/effects/"+effect).show()
#	else:
#		get_node("ui/effects/"+effect).hide()

func _ready():
	if hide_mouse:
		Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)	
	cursor = cursor_prefab.instance()
	add_child(cursor)
	var song
	if level_id == 0:
		song = preload("res://audio/music/level_0.it")
	elif level_id == 1:
		song = preload("res://audio/music/level_1.it")
	else:
		song = preload("res://audio/music/level_2.it")
	audio.play_stream(song)
	set_process(true)
