Hi
I create game with lots of lines of codes.
So, I use a lot of include files.
I have a file named include.agc, in whixh i include my files :
#includefile "player.agc"
#includefile "mob.agc"
...
I try to create the functions with the filename in its name.
Eg :
in player.agc, i can have :
Initplayer (), resetplayer (), moveplayer (), eventplayer ()....
In mob.agc (= monsters) : initmob (), addmob (), deletemob (), movemob (), eventmob ()
Eventplayer () or eventmob () is the general function I put in the main loop of the level screen for exemple.
For some utilities, i have a file name util.agc, with :
Min (), max (), math functions, ...
Text function : text.agc
Menu functions : menu.agc
And so...
So my loop (in screengame.agc) is in general :
Repeat
// here i add the pointer, input needed
If getrawkeypressed (27)
Quit =1
Endif
If GetPointerReleased ()
// get sprite hit, to test the ui
Endif
//then, the game event
Eventplayer ()
Eventmob ()
Eventfx ()
Until quit > 1
I hope this can help.
AGK2 tier1 - http://www.dracaena-studio.com