2 Step Forwards, 1 Step Back

Blitz3D Forums/Blitz3D Programming/2 Step Forwards, 1 Step Back

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.

Break up your code into separate files and include them, modular code makes life simpler.

I usually have all my types in their own file along with all the functions that create / delete / update the type.

For example they might be an Alien type so the file would hold the type declaration and Alien_New(x,y), Alien_Kill(a.Alien), Alien_Update() etc etc. So I know that anything about Aliens, controlling, updating, loading, killing etc is all in that one file.

On top of that I'd have a file for Input, which will deal with input devices regardless of what that might be, so the game itself functions on common commands. Eg, I have an X/Y axis variables (-1 to 1) regardless on if I'm using keyboard, mouse or joypad. So the game works based on those variables rather than directly querying your input device.