-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.gd
More file actions
35 lines (29 loc) · 954 Bytes
/
Game.gd
File metadata and controls
35 lines (29 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var yay = false
var happened = false
var tracks = []
# Called when the node enters the scene tree for the first time.
func _ready():
# print(Global.track_playing)
# print(Global.tracks[Global.track_playing]["track"])
add_child(Global.tracks[Global.sec_playing][Global.track_playing].instance() if Global.track_playing != -1 else Global.intro_track.instance())
$OpponentGhost.type = Global.opp_type
$PBGhost.type = "pb"
func _process(delta):
if yay:
Global.track_has_finish = false
for i in get_child(3).get_children():
if("Start" == i.name):
get_tree().call_group("Player", "set_start", [i.position, i.rotation])
if("Finish" in i.name):
Global.track_has_finish = true
yay = false
happened = true
elif not happened:
yay = true
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass