change an entire column in array?

  • 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 don�t 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just use a For loop to set all to NotEquipped first, THEN set the appropriate slot to Equipped.

  • Sorry but I dont quite get how to use the for loop in the array to solve my problem, I�m 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)