diff --git a/GasCounter.gd b/GasCounter.gd index deb7e2b..177ccae 100644 --- a/GasCounter.gd +++ b/GasCounter.gd @@ -14,3 +14,22 @@ func _ready() -> void: func _process(_delta: float) -> void: set_amount(GameState.gas) + + +func _draw() -> void: + # Gas keeps the segmented count used by ore, but replaces ore's mining + # hex with the three-bubble resource glyph. The label above it now names + # the same icon rather than describing a pink recolour of ore. + var h: float = digit_height + var s: float = h / 60.0 + for bubble in [[Vector2(21, 36), 13.0], [Vector2(35, 42), 17.0], [Vector2(39, 23), 9.0]]: + var ring := PackedVector2Array() + for i in range(12): + var angle := TAU * float(i) / 12.0 + ring.append((bubble[0] + Vector2(cos(angle), sin(angle)) * bubble[1]) * s) + NeonDraw.draw_glowing_polygon(self, ring, GAS_GLOW, 1.0, GAS_CORE, 0.55 * s) + var x: float = h * 1.10 + var w: float = h * 0.56 + for digit in str(maxi(amount, 0)): + _draw_digit(int(digit), Vector2(x, 0.0), w, h) + x += w + digit_gap diff --git a/Main.tscn b/Main.tscn index 51ca900..5e30cba 100644 --- a/Main.tscn +++ b/Main.tscn @@ -114,16 +114,6 @@ offset_bottom = 92 script = ExtResource("25") digit_height = 60.0 -[node name="GasIcon" type="Control" parent="UI"] -mouse_filter = 2 -offset_left = 476 -offset_top = 32 -offset_right = 524 -offset_bottom = 80 -script = ExtResource("10") -icon = 25 -glow_color = Color(0.85, 0.52, 1, 1) - [node name="GasCaption" type="Label" parent="UI"] mouse_filter = 2 offset_left = 294