initialized levels and players on the loading function.
This commit is contained in:
+5
-1
@@ -12,11 +12,15 @@ func load_lvl( lvl_index: int ):
|
|||||||
var lvl: Node = load( lvl_path ).instantiate()
|
var lvl: Node = load( lvl_path ).instantiate()
|
||||||
G.add_child( lvl )
|
G.add_child( lvl )
|
||||||
L = $Game/Level
|
L = $Game/Level
|
||||||
|
init_lvl()
|
||||||
|
|
||||||
func load_plyr():
|
func load_plyr():
|
||||||
var plyr = load("res://scenes/Player.tscn").instantiate()
|
var plyr = load("res://scenes/Player.tscn").instantiate()
|
||||||
G.add_child( plyr )
|
G.add_child( plyr )
|
||||||
P = $Game/Player
|
P = $Game/Player
|
||||||
|
init_plyr()
|
||||||
|
func init_lvl():
|
||||||
|
pass
|
||||||
|
|
||||||
func init_plyr():
|
func init_plyr():
|
||||||
P.set_gravity_vector( Vector2(0,1) )
|
P.set_gravity_vector( Vector2(0,1) )
|
||||||
@@ -29,7 +33,7 @@ func _ready():
|
|||||||
|
|
||||||
load_lvl(curr_lvl)
|
load_lvl(curr_lvl)
|
||||||
load_plyr()
|
load_plyr()
|
||||||
init_plyr()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ var lvl_paths: Array[String] = [
|
|||||||
const STARTING_LIVES: int = 3
|
const STARTING_LIVES: int = 3
|
||||||
|
|
||||||
## Preferences
|
## Preferences
|
||||||
var show_splash: bool = false
|
var show_splash: bool = false
|
||||||
|
|
||||||
func fade( type: String , t: float ):
|
func fade( type: String , t: float ):
|
||||||
var fade = load("res://scenes/ui/fade.tscn").instantiate();
|
var fade = load("res://scenes/ui/fade.tscn").instantiate();
|
||||||
|
|||||||
Reference in New Issue
Block a user