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.

43 lines
789 B

extends Node2D
var G: Node2D
var L: Node2D
var P: CharacterBody2D
var curr_lives: int = PDash.STARTING_LIVES
var curr_lvl: int = 1
func load_lvl( lvl_index: int ):
var lvl_path = PDash.lvl_paths[ lvl_index-1 ]
var lvl: Node = load( lvl_path ).instantiate()
G.add_child( lvl )
L = $Game/Level
init_lvl()
func load_plyr():
var plyr = load("res://scenes/Player.tscn").instantiate()
G.add_child( plyr )
P = $Game/Player
init_plyr()
func init_lvl():
pass
func init_plyr():
P.set_gravity_vector( Vector2(0,1) )
# Called when the node enters the scene tree for the first time.
func _ready():
G = $Game
PDash.fade( "in" , 1 )
load_lvl(curr_lvl)
load_plyr()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass