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()
|
||||
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) )
|
||||
@@ -29,7 +33,7 @@ func _ready():
|
||||
|
||||
load_lvl(curr_lvl)
|
||||
load_plyr()
|
||||
init_plyr()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user