Multiple game loops?

Blitz3D Forums/Blitz3D Beginners Area/Multiple game loops?

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.

if i understand correctly you have some functions that don't return each frame to the main loop freezing it


you can use a kind of flag to keep track of the active function then jump each frame to this function until it's complete

for exemple when you have to jump to a function, set your flag to something

actualy your code may look iike that

mainloop
code
code
code
if condition:function1():endif
code
code
code
/mainloop

function1()
loop
code
code
code
/loop until condition
return



------------------

you can make it look like that
mainloop
code
code
code
if condition:flag=1:endif
select flag
case 1
function1()
end select
code
code
code
/mainloop

function1()
code
code
code
if condition
flag=0
endif
return

so the program still execute your main loop and jump every frame to your procedure until the same condition occurs ...

i admit that it's a difficult and looking weird way of code stuff :)