diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-11-14 17:19:33 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-11-14 17:19:33 +0100 |
| commit | e48d0f47fac4f6a07a1a851fea7b9ae08154ebb6 (patch) | |
| tree | f0405cadef04a3dee0cdad795d4af75a45710f57 /powerup.gd | |
| parent | 648f1928549e371fe55fd23f4dde3fdd85266375 (diff) | |
| download | nj26-e48d0f47fac4f6a07a1a851fea7b9ae08154ebb6.tar.gz | |
Implement powerups
Diffstat (limited to 'powerup.gd')
| -rw-r--r-- | powerup.gd | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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") |
