I've been wondering how to structure my game. I've been told that all objects(types) must be created before the loop, but won't that be overloading? And take time?
Why not just create the objects as you need it? and then destroy them?
My idea of a game structure would be as follow (although it did not work at all)
Types not included in the above, i dont see the point. Anyway I get an error which probably means I can't create un object in the loop.
I have a hard time picturing how to structure my game with multiple rooms.. like intro, menu, stage1..stage2?
If you could give me some help with this, it would be very appreciated!
Why not just create the objects as you need it? and then destroy them?
My idea of a game structure would be as follow (although it did not work at all)
Graphics 800,600,0 ' Set Transparency SetBlend(ALPHABLEND) ' Globals & Constants Global gm_room :Int = 0 Global gm_donce :Int = 0 Global gm_exit :Int = 0 ' Included Files Include "textfields.bmx" Include "buttons.bmx" While Not KeyHit(KEY_ESCAPE) Select gm_room Case 0 ' DO ONCE If gm_donce = 0 Then Local test1:Tbutton=New Tbutton test1.create(10,10,"test") gm_donce = 1 EndIf ' LOOP test1.Update() End Select Flip; Cls Wend End
Types not included in the above, i dont see the point. Anyway I get an error which probably means I can't create un object in the loop.
I have a hard time picturing how to structure my game with multiple rooms.. like intro, menu, stage1..stage2?
If you could give me some help with this, it would be very appreciated!