I am currently creating a clicker game and want to have a shop. I am using Panel sprite buttons (from the PanelSpriteButton extension) to create items. These have 3 states: Idle, Hovered and Pressed , which works great if the player has enough money, but still play an animation if they don’t. Videos I have seen say to just not subtract the money if they don’t have enough. However, I don’t want the player to be able to press the button at all, I would like the button to be disabled.
Ideally I would like this to be supported by the extension but if anyone has ways to work around this they would be appreciated.
Hi, I have no experience with the extension. I just tried to use it now and failed (I created a panel sprite object but for whatever reason I cannot use it with the conditions of the extension).
Anyway, you you could use a boolean variable that sets your buttons active (variable is set to true) so they can be clicked, hovered etc. and an inactive state (variable is toggled to false) if the player has not enough money.
Do you mind sharing your event sheet? In the mid time, you can try loop through items, compare their cost and player’s current amount of money, and deactivate PSB behavior if player doesn’t have enough money. You can do that for example every time AFTER player purchases an item, or receive money, or just that will do that, depends how your game works.