fguihen Posted February 19, 2005 Posted February 19, 2005 i am writing an application that simulates a crowd moving through a building. it is done using windows forms and GDI. i may need to pause it on and off and i cant figure out how to do this. i know it could be done using threads but im unsure how. the program is all run from the main form, with all classes being called from here.any ideas on how i might sort this? Quote
Diesel Posted February 22, 2005 Posted February 22, 2005 a really simple option would be to use a flag and if that flag is true, run the logic, if not, skip it. bool PauseFlag = true; if (PauseFlag) { //draw, move whatever } Quote
Leaders snarfblam Posted February 22, 2005 Leaders Posted February 22, 2005 The method used to pause it really depends on how you are implementing this program. If you are using some sort of timer, you could stop it to pause and start it to unpause. In any other situation I can think of Diesel's solution would work fine. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.