0 votes

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)
        print("Not yet sir")

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

Thanks for the help.

Godot version v3.3.4.stable.official [faf3f883d]
in Engine by (12 points)

1 Answer

0 votes

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

by (87 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.