Dear Construction-twoians,
Arrays. Awesome stuff. Just started using them and am running into issues left and right. I have a hard time understanding them fully atm, but hopefully some of you can lend a helping hand.
The array:
I am using a 1d array:
"Characters": 6 rows on X. Each X holds the name of a character class:
0: Warrior 1: Knight 2: Thief 3: Hunter 4: Mage 5: Wizard.
The objects:
0: Player spawning point sprite
1: Player collision box (Platformer behaviour)
2: Warrior sprite
3: Knight sprite
4: Thief sprite
5: Hunter sprite
6: Mage sprite
7: Wizard sprite
If the player clicks on one of these sprites, the array will select the relevant value (click warrior and the array will choose 0 etc), the next layout (an actual level) is loaded, the "player collision box" is created on the "player spawn point".
My question is: how can I attach the sprite, chosen by the array, to the "Player collision box"?
In other words: how do you use an array's index number and use it to spawn/create/set position of an actual object?
Thanks in advanced, I am in your hands!