Added: 1 year ago
From: MrMisanthropy
Views: 224
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (4)

Sign In or Sign Up now to post a comment!
  • @xxxcoolboyxxx - yes that worked! although now....whatever button i press my character .jpg goes to the left. :/ The code logic looks like it would not do this though.

  • @MrMisanthropy To make sure that the character doesnt only move to the left, the if statements in the dude class must look like this:

    if(key == KeyEvent.VK_LEFT){ dx = -1; } if(key == KeyEvent.VK_RIGHT){ dx = +1; }

  • I think its not detecting that you already have an actionPerformed method, and when you click "add unimplemented methods", it adds another actionPerformed method (even though there is already one in there (with p.move()).

    Maybe keep the actionPerformed method it creates and add the two lines in there from the other preexisting method. See if that works.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more