Various recolorings and selection
This commit is contained in:
+13
-3
@@ -1,7 +1,8 @@
|
||||
extends Node
|
||||
export (PackedScene) var Creature
|
||||
|
||||
var selected;
|
||||
var selected = []
|
||||
var id_counter = 0
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
@@ -9,15 +10,24 @@ func _ready():
|
||||
func spawn_a_bitch():
|
||||
# Maak een bitch
|
||||
var c = Creature.instance()
|
||||
c.creature_id = id_counter
|
||||
id_counter += 1
|
||||
add_child(c)
|
||||
|
||||
# Geef de bitch een random positie en rotatie
|
||||
c.rotate_y(rand_range(-5, 5))
|
||||
c.transform = Transform(c.transform.basis, Vector3(rand_range(-7, 7), 0, rand_range(-5, 5)))
|
||||
print_tree ( )
|
||||
# print_tree ( )
|
||||
|
||||
func kill_a_bitch():
|
||||
var c = get_child(get_child_count()-1)
|
||||
if c:
|
||||
c.queue_free()
|
||||
#remove_child(c)
|
||||
#remove_child(c)
|
||||
|
||||
func select_a_bitch(camera, event, click_position, click_normal, index, creature_id):
|
||||
if event.is_action_pressed("select_creature"):
|
||||
var kindeke = get_child(creature_id)
|
||||
selected.push(creature_id)
|
||||
kindeke.get_node("SelectionIndicator").visible = true;
|
||||
print(creature_id)
|
||||
Reference in New Issue
Block a user