Computer Science Canada How Do You Tell a Process to Quit |
Author: | hello [ Tue Jun 03, 2003 2:57 pm ] |
Post subject: | How Do You Tell a Process to Quit |
we have enemies with a process and a corresponding proc that draws it our collision detection is in the proc and when the proc quits we want the process to quit also and not keep on running example: process enemy1(aa,a...) position of enemy changes end enemy1 proc enemydraw draw enemy collision detection then quits end enemydraw we want the proc to somehow tell the process to quit also at tge time of collision detection |
Author: | Catalyst [ Tue Jun 03, 2003 3:39 pm ] |
Post subject: | |
return will end the process |
Author: | naoki [ Tue Jun 03, 2003 9:54 pm ] |
Post subject: | |
return was tried, but it either didn't quit properly or it quit a huge chunk of the game the point is that there are still things that run because of that fork, and if we destroy it we might not be able to retrieve that info or call it again. i'll try and tell you later. |
Author: | void [ Tue Jun 03, 2003 10:10 pm ] |
Post subject: | |
hmmmmm...im not sure...but i would prolly use this method: create an integer (switch) and give it a 0 value....and when the proc quits....make the variable equal to 1..and where ever you tell your process to be forked make it an if statement if switch =0 then fork process end if and whenever the collision occurs make switch:=1...that should work...but if this is like a shooting game...then u might wanna reset the variable switch every time you shoot...i dunno if this helps...i'll do some reaading on procedures (my CS teach has the books)....and ill respong ASAP.... |