Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

array call function?

1) is there a way i can call a different array based on a variable?

for instance: I have 4 arrays:

Aluxes = [1,2,3,4]
Basil = [5,6,7,8]
Cyris = [9,10,11,12]
Dorothy = [13,14,15,16]

how can tell the game to call a different array based on the character in question? (i.e. @actor_name[2] or sumthin)

2) if this is possible, can i have it call it more like this?:

Aluxes_stats = [1,2,3,4]
Basil_stats = [5,6,7,8]
Cyris_stats = [9,10,11,12]
Dorothy_stats = [13,14,15,16]

andtell the game to call a different array based on the character in question with _stats added? (i.e. @actor_name+"_stats[4])???
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top