Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Slick2D: Call to update() method freezes/crashes program

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Slick2D: Call to update() method freezes/crashes program

    I'm working on a game with some basic graphics that uses Slick2D to handle animations. In order to display an animation I have to display an image that's both rotated and scaled, so I quickly discovered that none of the methods in the Animation class would work for me.

    The solution I came up with was to draw the image at Animation.getFrame() (the animation's current image). To update the image I call the following lines of code:

    System.out.println("Updating animation data...");
    a.setAutoUpdate(false);
     
    a.update(delta);
     
    System.out.println("...done!");
    I added the a.setAutoUpdate() call to exclude the possibility that anything else was updating the animation at the same time.

    What happens is this: Everything seems to run fine until "Updating animation data..." is printed out. Then the window the game is running in freezes and must be force exited. "...done!" never prints out.

    This tells me the code is freezing on "update". Can anyone help me figure out why??


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,318
    Thanks
    56
    Thanked 2,374 Times in 2,345 Posts

    Default Re: Slick2D: Call to update() method freezes/crashes program

    Can you make a small, complete program using only Java SE classes that compiles, executes and shows the problem?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. update static field and call method within the class?
    By GeneralPihota in forum Object Oriented Programming
    Replies: 7
    Last Post: February 6th, 2012, 09:20 PM
  2. How do I call a method from the main method?
    By JavaStudent1988 in forum Java Theory & Questions
    Replies: 5
    Last Post: October 19th, 2011, 09:37 PM
  3. Can i call init() method in destroy method.?
    By muralidhar in forum Java Servlet
    Replies: 1
    Last Post: October 22nd, 2010, 12:18 PM
  4. How to make an error message when my program crashes?
    By noFear in forum Java Theory & Questions
    Replies: 10
    Last Post: August 11th, 2010, 09:50 AM
  5. JSP freezes after AJAX call !!
    By java_freek in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: April 16th, 2010, 11:31 AM