Is there a way to automate variable names

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Radical
Posts: 38
Joined: January 15th, 2017, 9:16 pm
Location: Ontario

Is there a way to automate variable names

Post by Radical » September 5th, 2017, 5:01 am

EDIT: This has been solved. Tutorial 13 is what I required.

I am working on a game right now, and have to make many different platforms for my dude to land on. I am having to make a new bool for each platform, all of which are initialised to false. isLanded1, isLanded2, isLanded3, etc.

In the previous game I posted on here, I had to do the same thing, but it got to the point where I had to create functions to hold all the functions to hold all the giant, giant lists of duplicate variable names. I want to avoid this and increment the variable names somehow.

isLanded++ would save my life. But I realise it doesn't work that way since the compiler sees the name as a name, not an int.
Last edited by Radical on September 5th, 2017, 6:13 am, edited 1 time in total.

ceofil
Posts: 39
Joined: April 13th, 2017, 8:35 pm

Re: Is there a way to automate variable names

Post by ceofil » September 5th, 2017, 5:30 am

Watch the video about arrays (beginner 13).

User avatar
Radical
Posts: 38
Joined: January 15th, 2017, 9:16 pm
Location: Ontario

Re: Is there a way to automate variable names

Post by Radical » September 5th, 2017, 5:31 am

Ah, okay. I'm only on tutorial 8 right now. I will check it out.

Post Reply