Setting up shop system (solved)

Get help using Construct 2

Post » Mon Aug 19, 2013 1:32 am

Hi all, I'm trying to set up a shop in my game and I'm running into some problems refusing sales if the player doesn't have enough credits.

Probably an obvious solution but it IS 1.30am and I'm knackered...

Any ideas would be appreciated!ReanimtedNerd2013-08-19 10:19:10
B
11
S
1
Posts: 40
Reputation: 485

Post » Mon Aug 19, 2013 6:48 am

Posting a .capx would make answering your question possible, as you can do this in million ways and we have no idea how you've approached it... :)

Here is one way:

You probably got variable money on player object.

on buy event
player.money > item.price
.. buy
else
.. play not enough money sound or something
B
24
S
9
G
7
Posts: 756
Reputation: 7,302

Post » Mon Aug 19, 2013 9:13 am

Thanks for the reply! However, after a decent night's sleep I managed to figure it out. Basically the game checks if the global variable "Credits" is greater or equal to 100-shiphealth, and if so it does the repair. If not, it displays an error message.

Cheers though!
B
11
S
1
Posts: 40
Reputation: 485


Return to How do I....?

Who is online

Users browsing this forum: Ashley, tarek2 and 39 guests