Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    You need to clear the graphics context before doing a new drawing by calling the super method that you have commented out.
    //super.paintComponent(g);
  2. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    Is that the answer for question 3) or is that just for the code in the timer?
    What about the other questions in post #12?
  3. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    What prints out from the printlns you should be adding?

    What are your answers to the questions I asked in post #12?
  4. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    How are you doing the debugging?
    I use calls to println statements that print out the values of variables so I can see what the computer sees. If you know what you want the code to do, then when you...
  5. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    Where does the code change the location of the snake? How often is the draw() method called?
    Do the x & y values for the snake's location ever change?

    Why does the code call repaint() so many...
  6. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    The code you posted is incomplete. It's missing the end of the source.
  7. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    I think there is more than one problem. Which one are you working on?
  8. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    To see what the code is doing, try debugging it by adding some println statements that print out the values of variables that control execution and the location of the shapes. The print out will...
  9. Replies
    20
    Views
    2,311

    [SOLVED] Re: Help with the Snake in a Snake Game

    When I execute the code I see a red shape and a blue shape at random locations.
    The red shapes moves when a keyboard arrow is pressed.

    Can you explain what the code is supposed to do?
Results 1 to 9 of 9