I’m making a tower defence game and I need to make it wait before spawning(painting) the next monster.
Firstly, you need to realize that creating an object and drawing a picture on the screen are two entirely different things.
Secondly, you don’t want to sleep the whole thread. That would make your application hang (and so the user could do absolutely nothing) until the next unit spawned, at which point it would promptly hang again.
You want to use a timer.
|