Results 1 to 5 of 5
  1. #1
    rajkobie is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default How do I reduce lag in a java game that I am making?

    I am making a game in Java. It works without lag as long as i keep playing it. If i die and restart the game, i starts lagging, if i die and restart the game again, it lags even more. lag gets worser each time you restart. I cannot provide the code. But i think the problem is that i am not properly disposing the objects after each restart. How can i dispose the objects in a JPanel?

    Sorry for the limited info, help would be appreciated

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by rajkobie View Post
    I am making a game in Java. It works without lag as long as i keep playing it. If i die and restart the game, i starts lagging, if i die and restart the game again, it lags even more. lag gets worser each time you restart. I cannot provide the code. But i think the problem is that i am not properly disposing the objects after each restart. How can i dispose the objects in a JPanel?

    Sorry for the limited info, help would be appreciated
    Seriously. Without code, it is likely nigh well impossible to help you.
    Last edited by Fubarable; 05-13-2011 at 02:38 AM.

  3. #3
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    393
    Rep Power
    4

    Default

    Best I can figure is that there's a list somewhere that isn't reset and still keeps references to the old objects. But without code, it's impossible to say which list, or if it even is that way.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Heck, we've already been through this same game before with you:

    How to stop lagging in a JPanel?

  5. #5
    rajkobie is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default

    Quote Originally Posted by Toll View Post
    Best I can figure is that there's a list somewhere that isn't reset and still keeps references to the old objects. But without code, it's impossible to say which list, or if it even is that way.
    Thanks for the tip. I figured out the set to reset. Thanks alot again

Similar Threads

  1. Making a breakout Game
    By JavaIsSoEasy?? in forum Java Gaming
    Replies: 0
    Last Post: 03-05-2011, 11:52 AM
  2. Making hangman game
    By Snow_Fox in forum New To Java
    Replies: 0
    Last Post: 11-29-2010, 10:42 PM
  3. Game making help
    By Mrkantaloupe in forum New To Java
    Replies: 2
    Last Post: 07-13-2010, 11:15 PM
  4. need help making a game board
    By Don k in forum New To Java
    Replies: 2
    Last Post: 04-30-2010, 01:09 AM
  5. Java Applet Help - Making "Snake" Game
    By Alphimeda in forum Java Applets
    Replies: 15
    Last Post: 04-04-2010, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •