summaryrefslogtreecommitdiff
path: root/powerup.gd
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-11-14 17:19:33 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-11-14 17:19:33 +0100
commite48d0f47fac4f6a07a1a851fea7b9ae08154ebb6 (patch)
treef0405cadef04a3dee0cdad795d4af75a45710f57 /powerup.gd
parent648f1928549e371fe55fd23f4dde3fdd85266375 (diff)
downloadnj26-e48d0f47fac4f6a07a1a851fea7b9ae08154ebb6.tar.gz
Implement powerups
Diffstat (limited to 'powerup.gd')
-rw-r--r--powerup.gd18
1 files changed, 17 insertions, 1 deletions
diff --git a/powerup.gd b/powerup.gd
index a5cab6e..fa8b038 100644
--- a/powerup.gd
+++ b/powerup.gd
@@ -4,6 +4,8 @@ enum Type {
none
magnet
explosion
+ superspeed
+ swap
max_pw
}
@@ -13,7 +15,21 @@ var mytype
func get_type():
return mytype
+func _ready():
+ var color = Color(0, 0, 0, 0)
+
+ match mytype:
+ Type.magnet:
+ color = Color(0, 0.8, 0.8, 1.0)
+ Type.explosion:
+ color = Color(0.8, 0, 0, 1.0)
+ Type.superspeed:
+ color = Color(0, 0.8, 0, 1.0)
+ Type.swap:
+ color = Color(0.8, 0.8, 0.8, 1.0)
+
+ $light.light_color = color
+
func _init():
mytype = randi() % (Type.max_pw - 1) + 1
- print("type=%d" % mytype)
add_to_group("powerup")