Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help improving my game

 
Chee Yee Chin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, This is my first time posting on Java Ranch Forum.

Here is my problem that I would request for help with. I have created a card matching game using a JPanel as the display are for the game. The game seems to work fine. I still need to solve an issue with the processor, the processor is running at 70% for my simple program. the RAM memory is 25MB. that is quite big compare to Windows solitaire 5MB. I am wondering if my code can be optimize further (reduce size and processor usage.). anyone have any suggestion?

Here are the codes and screenshot attachment of the of my game. My apology if the post is too long.

1. Viewport - to be extended by the main game display


2. BaseFrame - JFrame that will hold the Viewport.



3. MatchDisplay - the actual Display


4. Deck


5.Desk - Place where I put the card


6. Card - finally the last class the card it self.
Screenshot.jpg
[Thumbnail for Screenshot.jpg]
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following are my suggestions.

1. You may not implement all *Listeners in the ViewPort class
2. You may create separate *Listener classes and instantiate them to use within the MatchDisplay class
3. You may merge Deck and Desk classes
4. You may eliminate BaseFrame class and do the needful within the MatchDisplay class
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic