Cycle through all your entities without types or other structures.

Blitz3D Forums/Blitz3D Programming/Cycle through all your entities without types or other structures.

My main loop just went from this:
For player.player=each player : updateplayer player : Next
For flare.flare=each flare : updateflare flare : Next
For trigger_hide.trigger_hide=each trigger_hide : updatetrigger_hide trigger_hide : Next
For trigger_show.trigger_show=each trigger_show : updatetrigger_show trigger_show : Next


To this:
UpdateEntities CLASS_PLAYER
UpdateEntities CLASS_FLARE
UpdateEntities CLASS_TRIGGER_HIDE
UpdateEntities CLASS_TRIGGER_SHOW


There's other ways you could have done this, but accessing the entities directly, and storing data in the entity structure, as opposed to storing the entity somewhere in a data structure, are by far the best/easiest/most versatile methods. This allows a totally different entity-oriented coding style, where all you need to access all parameters is the entity variable.

This is REALLY cool! It's like a new language.