Two Laptop Bag*
The moose likes Game Development and the fly likes Need help improving my game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Need help improving my game" Watch "Need help improving my game" New topic
Author

Need help improving my game

Chee Yee Chin
Greenhorn

Joined: Jul 07, 2011
Posts: 1
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.


[Thumbnail for Screenshot.jpg]

Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

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


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help improving my game