How do I make upgrades loop

Get help using Construct 2

Post » Wed Jul 30, 2014 10:28 pm

i have a global variance named Money. I have system adding 1 every 1 second. I have a button to purchase an upgrade that is supposed to add 100 to the "Money". Now the part i'm stuck on is I want that upgrade to continue adding 100 to the global variance every 5 seconds after the upgrade purchase. So I get 1 money every 1 sec and 100 money every 5 secs, if i purchase another upgrade it should add yet another 100 to the Money count. I've searched here in forums and youtube videos about Looping but I haven't seen anything that shows what I need to make this work. Can anyone point me in the direction I need please?
B
6
S
1
Posts: 36
Reputation: 452

Post » Wed Jul 30, 2014 11:51 pm

Add a global variable called "bonus" with the default value at 0.

Add an event stating if the player clicks on the upgrade button, then "bonus" = 1.

Add another event stating if "bonus" = 1 then every 5 seconds add 100 to money. You'll have to create a sub-event in order to do this.

If you provide the capx. file I can do it for you. :)
B
7
S
2
G
1
Posts: 7
Reputation: 562

Post » Thu Jul 31, 2014 1:36 am

I am really new to all of this so can't even figure out how to provide the capx. the best i can do is write it out. global number Money =0. 1) Event: System/ every 1 second, Action: System/ add 1 to Money. Text / set text to "Money: " & Money 2)Event: System/ Money equal or greater than 25, Action: Button2/ set visible 3) Event: Button clicked, Action: System/ add 1 to money 4) Event: button 2 click, Action: System/ Subtract 25 from Money.


I hope you can help from what i provided here because I tried what you said but couldnt see any way to make an event stating if "bonus" = 1
B
6
S
1
Posts: 36
Reputation: 452

Post » Thu Jul 31, 2014 4:05 am

I figured it out and Thank You so much for the help.
B
6
S
1
Posts: 36
Reputation: 452


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests