That is exactly what I have done. But as I show in the picture, it is still outside.
600 - 32 = 568. If y or x is below 568 it should be inside the frame, correct? In the picture in my post above...
Type: Posts; User: suumpmolk
That is exactly what I have done. But as I show in the picture, it is still outside.
600 - 32 = 568. If y or x is below 568 it should be inside the frame, correct? In the picture in my post above...
I wrote repaint(); inside moveImage() so it appears to be working now.
private void moveImage(){
int nextX = random.nextInt(600 - image.getWidth());
int nextY =...
I have followed the tutorial but I am not sure how repaint() works. This is the code I have written:
public class Main {
public static void main(String[] args) {
...
Hi, I'm new to Java and I just can't find out how to do this properly.
I have a main class that hold the frame and paints, a class for drawing my game, and an image that is drawn too.
I want to...