Ran into some similar problems the first time I wrote a game.  
JInvaders :)  The easiest thing I can suggest is have your game loop in
the main thread and have a "token" of control handed from player to
player. Have the player be either a user or a computer, but give each
one of them their own thread.  When they get the token (notify) they
are able to do something in the model.  This will also let your
computers perform strategic calculations off the main thread and allow
your users to do actions that don't impact game play without waitng for
their next "move".
Have some JInvaders code, but would guess that a google search would
result in much better threading game examples.   JInvaders was written
in Java 1.0  and recompiled with MS J++ to work in old versions of I.E.
boy do I not miss the early days of Java!

I haven't thought this all the way through and it has been a while....

Happy Holidays to all you back home! 

--- Warner Onstine <[EMAIL PROTECTED]> wrote:

> Or at least someone who's smarter than me ;-). I'm stuck on a project
> for school, essentially it is a Monopoly game. I have created a  
> separate thread that runs through the list of players and moves them.
> If they are a computer player then it rolls the dice for them, but  
> for the human players I want to allow the user to click the dice.
> I've tried a number of techniques to get the game thread to pause and
> wait for the user to click the dice but they've either resulted in  
> pausing the entire game and locking up the interface or just ignoring
> the other thread altogether.
> Any assistance is greatly appreciated as this is my first real time  
> with threads and it is driving me absolutely batty!
> -warner
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Todd R. Ellermann
President PHXJUG.org
602-738-6187 cell

Does getting an ASU MBA with existing UofA BSCE make me a SunCat? or a 

Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to