Help: Sprite Type: Tying graphics to instances?

BlitzMax Forums/BlitzMax Beginners Area/Help: Sprite Type: Tying graphics to instances?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi warpZone,

Im glad the code was of some help to you. I know its a bit of struggle to get to grips with new languages sometimes ( though as you learn more languages you will find new ones get easier to get to grips with ).

The simple answer to you question above about how to write code to read a text file to get a variable name and value is that you cannot.

All the variables you use must be defined at compile time. The reason I used an array for the enemy images was so that the loadImages function could be written to use a text file to get the list of images to load into each one.

If you *really* want the text file to supply a name for each image I guess you could create a new namedImage type which will contain a TImage field and a name string. You could then have a TList of namedImage. Whenever you wanted to reference a *named* image you would seaqrch the TList to find the matching name.

Hope that makes sense. I would try to write some code for an example but Im not at my home machine at the moment.