Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
Posted

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

}

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...