Mimicking 2d arrays
Ok, so now that exams are pretty much over, I can work on my cannon game again.
Here's my problem. Two players decide alternately between a set of randomly generated weapons (10 for each player.) Each weapon only has one use, so if a player selects two of the same type of weapon, then they get two shots of that particular weapon.
Now there are 25 different weapons in total and not all will be available to the player in a single round, so the index needs to be re-populated each time a new round is started.
For those of you that don't see the 2D array, there's a 10 index array that's given the weapon type. and then each weapon type has an ammo limit.
Any ideas how I can implement this? Game salad currently has no way to make arrays.
Here's my problem. Two players decide alternately between a set of randomly generated weapons (10 for each player.) Each weapon only has one use, so if a player selects two of the same type of weapon, then they get two shots of that particular weapon.
Now there are 25 different weapons in total and not all will be available to the player in a single round, so the index needs to be re-populated each time a new round is started.
For those of you that don't see the 2D array, there's a 10 index array that's given the weapon type. and then each weapon type has an ammo limit.
Any ideas how I can implement this? Game salad currently has no way to make arrays.
Comments
indeed , but you can easily do it with a few integers (or indexes) ..
You give each weapon a number .. then make some GAME attributes..
1) integer - "Player 1first weapon number" (can be 1-10 accordingly to what i read in your post)
2) integer - "Player 1 second weapon number" (again , can be 1-10 accordingly to what i read in your post)
3) index - "Player 1 first weapon rounds left" (according to your post it needs to set to 1 , then when you fire , it goes to 0 you need to have a rule that the player can't fire if it has 0 rounds left )
4)index - "Player 1 second weapon rounds left" (same as above )
All of these needs to be created also for player 2 .
Please please use a pen and a paper to keep track on your weapons and numbers , do not memorize 25 weapons ,
coding "complicated" arrays like this can be confusing , save yourself some time and write down as you work .
Hope it helps.
Roy
As an example all weapons numbers 1-25.
Let's say player 1 picks the following:
2, 3, 5, 8, 14, 15, 19, 19, 1, 23
That is now the setup. I want to be able to store these values into an array so that I can base my weapon select system around it. This I can already do. I just need away to store these values when selected by the player.
For me I have a day - let's call it 'Day 1'.
For this day I want to be able to store a number of choices you made i.e
a) How I felt in the morning (Good/Indifferent/Bad)
b) How I felt in the afternoon (Determined/Indifferent/etc)
c) What I actually did (Followed my plan/Took a rest/Abandoned my plan)
d) The player then clicks 'Save' all this shall be stored and then...
...these choices shall be stored depending on the buttons you click and then a 'Day Icon' shall be updated on another scene.
Also - those buttons on the 'Day 1' shall only be possible to select once and the 'Save' action is only allowed to do once so that you don't tamper and update the 'GameDayIndex'
lol...been playing around with this for hours without full success. I somehow get confused by GameAttributes, SceneAttributes and SelfAttributes...
So this was not a question - lol - more a reflection and possibly helping myself to explain the problem...
All the best,