Top Comments
All Comments (153)
-
get better audio plz
-
in order to place an image in any java code you can code it like this instead
ImageIcon i = new ImageIcon("C:\\Users\\Brad\\De
sktop\\TEMP FOR 1 DAY\\still.png"); add the double slashes because one slash means something else.
i figured this out :)
-
hmmm now how to turn it into a jar :P
-
@Robot9595 Thanks, I already solved it a while ago xD
-
@SuperBoombyebye Even though it's been about a month since this comment... Delete the semicolon after "if (key == KeyEvent.VK_LEFT / RIGHT)", that fixed the problem for me.
-
im having trouble changing the speed of the character. When i change dx = 1 to dx = 2 the guy moves faster but the background only loops twice and then stops at after the second and doesnt draw anymore. if anyone has tips on how to fix this left me know.
-
in Board.java when i type the keyrealeased and keypressed, i receive an error under p even though at the top, Dude p; and p = new Dude();
-
@SCARHExtendedMags - One lined if statements don't require the curly brackets to be used... But it won't cause any issues if you do use them.
-
@SCARHExtendedMags no cuz in the Dude.move() method, there is already a plus. no ur kidding right? u knew it
-
@PXP217 are you sure they are in the C:// drive?
That can be the only problem because, although horribly spaghetti, the code does work.
Guys there is a slight error in the program...
In the Dude class, the if statements inside the keyPressed and keyReleased must look like this:
if(key == KeyEvent.VK_LEFT){ dx = -1; } if(key == KeyEvent.VK_RIGHT){ dx = +1; }
SCARHExtendedMags 8 months ago 18
Thanks for the tutorial, I'm learning how to organize with this tutorial.
For the guys asking about Referring images....
The easiest way is to:
Go to the SRC Folder and create a new folder where your classes are. Call it images.
Place all your images there. Now everytime you initialize an ImageIcon, instead of passing a String, type in getClass().getResource("images/img.png")));
Easier and cleaner like this.
mmkirby2 4 months ago 3