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
|
||||
|
|
|
|||
Loading…
Reference in a new issue