Use gas glyph in HUD counter
This commit is contained in:
parent
ac5b5415f5
commit
af5e08e5a1
2 changed files with 19 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
10
Main.tscn
10
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue