How do I make Character Shop

Get help using Construct 2

Post » Mon Mar 28, 2016 4:39 pm

Ayolabi12345 wrote:@badmoodtaylor actually on second thought I actaully need the coins one, because If the past couple of days have taught me anything, it's that coin and high score are pretty different. Please Help!!


Are you using a global variable for the number of coins?
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Mon Mar 28, 2016 5:38 pm

Use arrays to save what your players have bought.

You can read up on arrays and their usage either on scirra own tutorials or any coding sites.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Tue Mar 29, 2016 6:42 pm

@badmoodtaylor I am using global variable called coins.
B
25
S
6
G
4
Posts: 173
Reputation: 3,933

Post » Tue Mar 29, 2016 10:50 pm

Ayolabi12345 wrote:@badmoodtaylor I am using global variable called coins.


Are you doing the following:
Adding to 'coins' when the player is collecting them
Comparing if 'coins' is greater than the cost of the item when a player tries to buy it
Subtracting from coins when purchase is made

If so, what else are you trying to do?
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Mon Apr 04, 2016 2:10 pm

@badmoodtaylor I did all of the above, I am trying to make it so that If the player exits the app then opens it again, they will still have their coins.
B
25
S
6
G
4
Posts: 173
Reputation: 3,933

Post » Mon Apr 04, 2016 7:14 pm

B
25
S
11
G
9
Posts: 136
Reputation: 6,657

Post » Mon Apr 04, 2016 11:37 pm

Wishy wrote:https://www.scirra.com/tutorials/1461/how-to-use-the-localstorage-plugin


Yes, @Ayolabi12345 are you using any method to save the game? If not it will return to default every time opened.
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Tue Apr 05, 2016 1:35 am

@badmoodtaylor I understand that I should use local storage, but when I try to do it it doesnt work. How would I phrase the series of events needed to make it work.
B
25
S
6
G
4
Posts: 173
Reputation: 3,933

Post » Tue Apr 05, 2016 2:20 pm

Image
this example will update the gold_key in the localstorage with the value of my gold variable...

Exactly as how it is explained in the link i gave you...
B
25
S
11
G
9
Posts: 136
Reputation: 6,657

Previous

Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin, Lancifer, mikehive and 32 guests