Bug or my fault? (types related)

Blitz3D Forums/Blitz3D Beginners Area/Bug or my fault? (types related)


I don't understand what do you mean for different variable name....i use jet.mainjet because jet.mainjet is the type instance....


Yes, but you can't use jet as the For/Each loop variable because it will be set to point to the next mainjet type in the list, after every loop. This will be a NULL pointer (zero) when the end of the list is reached. So, as you're using the global jet as the loop variable, it gets set to 0!

If you only have one mainjet type object in your game, you don't need to use a for/each loop. Storing the pointer to the single mainjet type in a global allows you to access it from anywhere in your program. If you're getting errors, you must be doing something else wrong.