Changed the way the fades work, and brought back in the Player
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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
|
||||
|
||||
func load_plyr():
|
||||
var plyr = load("res://scenes/Player.tscn").instantiate()
|
||||
G.add_child( plyr )
|
||||
P = $Game/Player
|
||||
|
||||
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()
|
||||
init_plyr()
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
Reference in New Issue
Block a user