2dSideScroller.avi
Loading...
224
views
Loading...
Uploader Comments (MrMisanthropy)
Video Responses
This video is a response to 1 - Java 2D Game Tutorial/Help (part 2) - Side-scrolling game
see all
All Comments (4)
-
@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...
@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 1 year ago