final commit
This commit is contained in:
@@ -7,14 +7,21 @@ extends Control
|
||||
@export var imDead := false
|
||||
|
||||
var upgradeID := ""
|
||||
#var amount := 1
|
||||
var timer := Globals.UPGRADE_TIMERSTART
|
||||
var amount := 1
|
||||
var timer = Globals.UPGRADE_TIMERSTART * pow(1.5, Globals.unlockedUpgrades.get("stopwatch", 0))
|
||||
var goldUpgrade := false
|
||||
|
||||
func _ready():
|
||||
if goldUpgrade:
|
||||
progressRect.hide()
|
||||
$goldrect.show()
|
||||
timer = 999
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if imDead and not $particles.emitting:
|
||||
queue_free()
|
||||
|
||||
timer -= delta * Engine.time_scale
|
||||
if not goldUpgrade: timer -= delta * Engine.time_scale
|
||||
|
||||
texture.scale += (Vector2(1, 1) - texture.scale) * 7 * delta
|
||||
texture.modulate.a += (1 - texture.modulate.a) * 7 * delta
|
||||
@@ -22,13 +29,14 @@ func _process(delta: float) -> void:
|
||||
progressRect.position.x += (timer / Globals.UPGRADE_TIMERSTART * 48 - progressRect.position.x) * 5 * delta
|
||||
progressRect.size.x += (48 - timer / Globals.UPGRADE_TIMERSTART * 48 - progressRect.size.x) * 5 * delta
|
||||
|
||||
amountLabel.text = str("x", Globals.unlockedUpgrades.get(upgradeID, -1))
|
||||
|
||||
amountLabel.text = str("x", amount)#Globals.unlockedUpgrades.get(upgradeID, -1))
|
||||
|
||||
if timer < 0 and not imDead:
|
||||
amount -= 1
|
||||
Globals.unlockedUpgrades[upgradeID] -= 1
|
||||
timer = Globals.UPGRADE_TIMERSTART
|
||||
if Globals.unlockedUpgrades[upgradeID] == 0:
|
||||
Globals.unlockedUpgrades.erase(upgradeID)
|
||||
if amount == 0:
|
||||
#Globals.unlockedUpgrades.erase(upgradeID)
|
||||
imDead = true
|
||||
$texture.hide()
|
||||
$progress.hide()
|
||||
|
||||
Reference in New Issue
Block a user