Clicker Game - How can I exponentially rise the price of an upgrade when you press "Buy"

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FullGlove

Hey guys I was looking for help on this upgrade system in a Clicker game I’m making.

Here’s the code for the upgrade which is a system to increase the CPS Level of the upgrade and increase the price of the upgrade.

Note: CPS(CrystalsPerSecond)

func _on_TextureButton2_button_down():
    if Global.Crystals >= Global.shop2+1*30:
        Global.shop2 += 3
        Global.CrystalsperSecond += 3
        Global.Crystals -= Global.shop2 + 1*10
        $ScrollContainer/VBoxContainer/TextureRect2/Level2.text = str(Global.shop2)            
        $ScrollContainer/VBoxContainer/TextureRect2/Price2.text = str(Global.shop2+3*10)
    else:
        print("Not yet sir")

I would like to increase the price exponentially but the CPS Level consistently.

Thanks for the help.

:bust_in_silhouette: Reply From: SF123

You could have a variable called price or prices and multiply the price you want by [number] each time you make a purchase.