forked from Dariasteam/TowerJumper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
segment.gd
35 lines (29 loc) · 925 Bytes
/
segment.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
extends Spatial
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _ready():
# Called every time the node is added to the scene.
# Initialization here
pass
func set_material(material):
get_node("REGULAR").set_material_override(material)
get_node("REGULAR/Cover").set_material_override(material)
func set_bad():
get_node("REGULAR/StaticBody").add_to_group("bad")
func explode():
var a = get_node("REGULAR/StaticBody");
if (a != null):
a.queue_free()
a = get_node("REGULAR/AnimationPlayer");
if (a != null):
a.play("explode")
func meteorize():
var a = get_node("REGULAR/StaticBody")
if (a != null):
a.queue_free()
var mat = FixedMaterial.new()
var color = get_tree().get_nodes_in_group("player")[0].color
mat.set_parameter(FixedMaterial.PARAM_DIFFUSE, color)
get_node("REGULAR").set_material_override(mat)
get_node("REGULAR/Cover").set_material_override(mat)