change an entire column in array?

Get help using Construct 2

Post » Wed Feb 12, 2014 1:35 am

Hi, sorry for my english in advance:

I am making a game in which you buy ships to play with. I want to use a array to make the changes in the ships that are equipped, this is my solution in theory:

this is an example of the array:

ship1---Equipped
Ship2---NotEquipped
Ship3---NotEquipped ... and so on

So, when the player equips "ship 3", for example, I want all the other ships to change to NotEquipped, this will make easier to add ships in the future. I dont know if there is a way to make a simple programming for this or a bunch of conditionals like:

IF click on "ship2 equipButton"------ set Ship1 to NotEquipped
                                      set Ship2 to Equipped
                                      set Ship3 to NotEquipped...

hope it was clear and someone can help.

thank you.
B
5
S
1
G
1
Posts: 4
Reputation: 856

Post » Wed Feb 12, 2014 2:03 am

Just use a For loop to set all to NotEquipped first, THEN set the appropriate slot to Equipped.
ImageImageImage
B
71
S
22
G
248
Posts: 3,756
Reputation: 138,058

Post » Thu Feb 13, 2014 8:53 pm

Sorry but I dont quite get how to use the for loop in the array to solve my problem, Im quite new using it, if you could be more specifir it will be a great help, Anyways I will try to figure it out. tnx for respopndig.
B
5
S
1
G
1
Posts: 4
Reputation: 856


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 46 guests