Completes the rainbow (whoops)

master
TechieDamien 2025-08-02 18:48:10 +01:00
parent 9b1fd3a8c2
commit 29e74e34ca
Signed by: TechieDamien
GPG Key ID: 2ACE3574E164B780
3 changed files with 12 additions and 12 deletions

View File

@ -23,15 +23,15 @@ font_color = Color(1, 1, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_opfnp"]
font_size = 160
font_color = Color(0, 0, 1, 1)
font_color = Color(0, 0.545, 0.545, 1)
[sub_resource type="LabelSettings" id="LabelSettings_cp0ys"]
font_size = 160
font_color = Color(0.545098, 0, 0, 1)
font_color = Color(0.4, 0.2, 0.6, 1)
[sub_resource type="LabelSettings" id="LabelSettings_yhxw7"]
font_size = 160
font_color = Color(1, 1, 0, 1)
font_color = Color(1, 0.270588, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_trj04"]
bg_color = Color(0, 0, 0, 1)
@ -126,7 +126,7 @@ texture = ExtResource("3_ce3w2")
script = ExtResource("4_n45e2")
[node name="Ouroboros3" type="Sprite2D" parent="Title"]
modulate = Color(0.4, 0.2, 0.6, 1)
modulate = Color(0, 0, 1, 1)
material = ExtResource("3_t1dhk")
position = Vector2(776, 178)
scale = Vector2(0.5, 0.5)
@ -134,7 +134,7 @@ texture = ExtResource("3_ce3w2")
script = ExtResource("4_n45e2")
[node name="Ouroboros4" type="Sprite2D" parent="Title"]
modulate = Color(1, 0.270588, 0, 1)
modulate = Color(0.545098, 0, 0, 1)
material = ExtResource("3_t1dhk")
position = Vector2(947, 181)
scale = Vector2(0.5, 0.5)
@ -161,10 +161,10 @@ label_settings = SubResource("LabelSettings_n45e2")
[node name="Label2" type="Label" parent="Title"]
layout_mode = 0
offset_left = 631.0
offset_top = 66.0
offset_right = 731.0
offset_bottom = 290.0
offset_left = 642.0
offset_top = 69.0
offset_right = 742.0
offset_bottom = 293.0
text = "b"
label_settings = SubResource("LabelSettings_opfnp")

View File

@ -7,6 +7,6 @@ var last_rotation_mult = 1
func _process(delta: float) -> void:
var head = get_tree().get_first_node_in_group("Head")
if head is SnakePart:
modulate = head.COLOURS[head.colour_index]
modulate = head.COLOURS[[head.colour_index % len(head.COLOURS)]]
last_rotation_mult = head.colour_index + 1
rotate(delta * ROTATION_SPEED * last_rotation_mult)

View File

@ -4,7 +4,7 @@ class_name SnakePart
const TILE_SIZE = 40
enum PartTypes {HEAD, BODY, TAIL}
enum States {ALIVE, DEAD, OUROBOROS, OLD_OUROBOROS}
const COLOURS = [Color.DARK_RED, Color.ORANGE_RED, Color.YELLOW, Color.WEB_GREEN, Color.BLUE, Color.REBECCA_PURPLE]
const COLOURS = [Color.DARK_RED, Color.ORANGE_RED, Color.YELLOW, Color.WEB_GREEN, Color.DARK_CYAN, Color.BLUE, Color.REBECCA_PURPLE]
var part_type : PartTypes = PartTypes.HEAD
var state : States = States.ALIVE
@ -214,7 +214,7 @@ func process_movement(new_direction : Vector2, prevent_movment : bool = false) -
func update_sprite() -> void:
sprite.modulate = COLOURS[colour_index]
sprite.modulate = COLOURS[colour_index % len(COLOURS)]
# Set the sprite based on state and part type
match part_type: