You should never use
PictireBox
for rendering complicated moving scenes, especially animated. This is one of the typical design mistakes demonstrated in many CodeProject Questions. Most experts advised to avoid it. I personally saw a number of projects which went nowhere due to this design mistake.
There is one alternative where the approach similar to what you want to do can be used: WPF. With WPF you can place objects on
Canvas
and animate them. I would highly recommend this for the games like yours. This does not work for
System.Windows.Forms
though.
You need to render whole scene in some control (or form) and trigger changes in rendering via
Control.Invalidate
. The complete scenario is shown in my recent Answer here:
draw rectangle after form loaded by time[
^]. You may think it describes overly simplified case. No matter, your problem requires exact same approach. You need to strongly separate data model of the game and its rendering. All changes should be done only on the model, rendering triggered in invalidation, and the rendering procedure should be exactly the same regardless the semantic state of your game's state machine: model in, rendering out.
Good luck,
—SA