Posted: Fri Nov 23, 2007 4:50 pm Post subject: End fork
Hey,
I know that processes are bad, but i need help to complete my game
how do i end a fork?
i tried having a code like:
code:
procedure wingame
if coins=2000 then
end fork PlayBackgroundMusic
fork wingamesound
end if
end wingame
and i get a whole bunch of errors saying that the end fork is supposed to be end if
if any one can help that would be greatly appreciated
Sponsor Sponsor
Tony
Posted: Fri Nov 23, 2007 7:30 pm Post subject: RE:End fork
a process is a void function with an additional "benefit" of being able to fork. You end it the same way you end any other function, that is -- get to the end of it (perhaps with an arbitrary return).
Posted: Fri Nov 23, 2007 9:09 pm Post subject: RE:End fork
Umm....
could you elaborate more on this?
Nick
Posted: Fri Nov 23, 2007 10:02 pm Post subject: RE:End fork
so a process will be called like this
code:
process playMusic(musicPath:string)
Music.PlayFile(musicPath)
end playMusic
and ur calling it with an end before you even fork it?
another note you do not need to end the process as it will automatically end as it finishes
Zampano
Posted: Fri Nov 23, 2007 10:19 pm Post subject: Re: End fork
Since to use that process you must be (or probably are) using a loop inside it at the same time, just make an exit when to leave the loop and finish the process.