How do I make an in game shop?

Get help using Construct 2

Post » Sat Nov 28, 2015 9:42 pm

Hello there i'm kinda new with construct 2, but i think i can handle the basics.
Currently i'm just building and creating stuff to learn more how this engine works.
I tried to search tutorial or instructions for this problem quite long, and came out with pretty much nothing.

What is the easiest way to create in game shop?
I tried to do simple simple one with few different sprites that are invisible in HUD layer. And when player is on collision with merchant the sprites will change to visible. Problems are that:
1) Its possible to press the invisible button.
2) If i have many different screens/buttons in the HUD layer it becomes really messy if i have everything in there.

The point is not to go to another layout, but that the shop window appears in the current one.

Thank you already :)
B
3
Posts: 3
Reputation: 181

Post » Sun Nov 29, 2015 2:42 am

for the 1st issue:
you can add variables to your buttons that tells if the button is enabled, then you add the condition "if button.enabled = True" to the event "on button clicked"
you can switch the value of this variable when you want to disable the button.

2nd issue:
simply create several layers: HUD1 HUD2... or window1, window2...
B
8
S
1
Posts: 76
Reputation: 628

Post » Sun Nov 29, 2015 11:02 am

Thank you yapiiiii :)
B
3
Posts: 3
Reputation: 181

Post » Sun Nov 29, 2015 3:46 pm

Okay i got myself bit confused.
I created global variable that defines if the group where i did put the "shop sprites" works or not.
But what if there is two selections in that shop [YES] and [NO]. If i select [NO] it closes the shop window until i trigger the merchant again. But if i press [YES] i don't want the whole shop thing to pop up again if i'm in collision with merchant again.
(I hope thats not too confusing)
I would appreciate if there is picture about this tutorial or instruction :)
B
3
Posts: 3
Reputation: 181

Post » Sun May 08, 2016 1:30 pm

sorry for the huge delay ;)
If you haven't solved your problem yet :
Simply add another variable (merchant, for instance) to enable or disable the merchant : if the shop is already open, then disable the merchant (merchant = 0). When you close the shop, re-enable the merchant (merchant = 1). That's all :)
B
8
S
1
Posts: 76
Reputation: 628


Return to How do I....?

Who is online

Users browsing this forum: Janaina, shushpo, Yahoo [Bot] and 4 guests