Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Game Implementation

Reply
Thread Tools

Game Implementation

 
 
pek
Guest
Posts: n/a
 
      01-26-2007
I have a Game class which has all the information about the current
state of the game (players, card state, player turn etc.). Then I have
an Engine class which does all the game logic (draw card, throw card
etc) and finally I have theGameGUI class which is basically a JFrame.
Now..the Engine class needs an EngineListener in his constructor which
it adds it to a List of listeners to inform every listener about
changes and events the game has. For example, if player1 throws a card
in the middle of the table, the Engine will use the method
middleDeckUpdated() of the EngineListener to inform every player of the
game that the middle deck has updated therefore every GameGUI should
remove all it's middle cards and call Engine's getMiddleCards()
function to basically updated the GUI or sometimes the Engine will use
EngineListener's addMiddleCard(Card card) method to send to all the
players the new card (everything in the GUI is cloned for security).

Question 1: Is simply updating the GUI every 2 seconds without
listeners better..?

Question 2: Is this possible to implement in J2EE..? Can the Engine
class be a bean that uses the listeners to update there GUI..? And if
it can be implemented, again, is it better..?

Questin 3: If updating is better after all, why..? I think that using
listeners would use less bandwidth because the server will inform the
client when to update and therefore the client won't have to blindly
update every 2 (or more) seconds..

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Game) - Homeworld 1999 Game of the Year johnnoblepi Computer Support 3 02-23-2008 08:16 PM
(Game) - Homeworld 1999 Game of the Year johnnoblepi Computer Support 1 02-23-2008 08:16 PM
Game programming for kids: looking for open source 2D game developmentkit Max Kubierschky Python 10 03-31-2007 07:18 PM
I need help with card game game of war in GUI enviroment judith Java 0 11-01-2006 06:11 AM
Java Game- Game can't find it's graphics jar file BlackHawke Java 12 01-26-2004 06:14 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57