I am making a game wumpus world in winforms in which an agent(computer) can move in 4 directions. I am using button control for base and showing and hiding images where ever needed. i used Thread.Sleep for that but problem is that when i click button nothing is showing on form. the process on background is working fine but it is not showing each step. and yes i am using Thread.Sleep
in current UI
Thread.
I want to show every step to users with interval of 2 seconds.
it's hard to answer without any code to go by, but the main problem as i understand it is that you change the look of the world, and then tell it to sleep, witch means nothing will be painted. and then when the thread wakes up, you again change the world and make it sleep. nothing will be painted that way.
better way to do it will be timer, make it a single timer and a queue of events that needed to be shown and you are on your way to do it.
are you working on winForms, because if you are working on WPF you can do much nicer things
Edit: I'm not saying that Timer is the best way to do it, but it's a good valid way