Help on 'types' please.

BlitzMax Forums/BlitzMax Beginners Area/Help on 'types' please.

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.

A list is just that. You don't have to bother yourself with the internal workings of it, just remember it has some simple methods associated with it.
Global BulletList:TList = createlist()

ListAddLast(<your list>, <object to add>)
ListRemove(<your list>, <object to remove>)

<your list>.clear()
<your list>.ValueAtIndex(index)


Like Grable says, to delete an object you mustn't have any references to it. This simply means that nothing points to it. Imagine telling your friends a secret. Now say you forget the secret and then all your friends forget it too. Nobody knows the secret so it disappears. This is the same as removing it from the list and making sure nobody else points to it.

global i:Bullet = new Bullet
ListRemove(BulletList, i)

Here the bullet still exists because it's held in i. Simply removing it from the List doesn't do the job. You'll need to also do:
i = null


Lists are a lot easier but not as quick as arrays.