Pause game

Does anyone here knows or has codes for pausing game and continue game? Thank You.
[89 byte] By [Jasonca] at [2007-11-26 23:34:57]
# 1
> Does anyone here knows or has codes for pausing game> and continue game? Thank You.void setPaused(boolean p) { paused = p;}
prometheuzza at 2007-7-11 14:55:59 > top of Java-index,Other Topics,Java Game Development...
# 2

> void setPaused(boolean p) {

>paused = p;

You should declare paused as volatile, i.e.,

private volatile boolean paused;

as you will likely set and clear it from the event dispatch thread and check its value from your various other game playing threads.

BillKriegera at 2007-7-11 14:55:59 > top of Java-index,Other Topics,Java Game Development...
# 3

> ...

> You should declare paused as volatile, i.e.,

>

> private volatile boolean paused;

>

> as you will likely set and clear it from the event dispatch

> thread and check its value from your various other

> game playing threads.

Sorry, I shoul've used sarcasm-tags instead of code-tags in my post.

; )

prometheuzza at 2007-7-11 14:55:59 > top of Java-index,Other Topics,Java Game Development...