-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference.gd
56 lines (45 loc) · 1.09 KB
/
reference.gd
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
extends Node
var world
var hand
var main
var player
var allies = []
var friends = []
var enemies = []
const DRAW = 3
const TEST_MODE = true
func _ready():
initialize()
pass
func initialize():
world = get_tree().get_root().get_node('World')
hand = world.get_node('Hand')
load_all()
func load_player():
player = world.get_node('Player')
# strictly friends
func load_friends():
friends = []
if world.get_node('Friend') != null:
friends.append(world.get_node('Friend'))
# friends + main character (i.e., player)
func load_allies():
allies = []
allies = friends + [player]
#print('reference allies: ', allies)
func load_enemies():
enemies = []
for container in world.get_node('Mob').get_children():
if container.get_children()[0] != null:
enemies.append(container.get_children()[0])
return enemies
#func load_enemies():
# var enemies_temp = []
# for container in world.get_node('Mob').get_children():
# enemies_temp.append(container.get_children()[0])
# enemies = enemies_temp
func load_all():
load_player()
load_friends()
load_allies()
load_enemies()