oh yes, I see exactly what you mean Norm. I never called it in the board.class! Thank you very much for your help, it works! Sorry I wasted your time not to notice that little detail I forgot.
Type: Posts; User: Montario
oh yes, I see exactly what you mean Norm. I never called it in the board.class! Thank you very much for your help, it works! Sorry I wasted your time not to notice that little detail I forgot.
I don't understand. I thought I have called the getImage() method of the cobblestone class. Isn't it right here or am I getting mixed up:
public Image getImage() {
return image;
}
}
I call it in my Cobblestone class here:
private String cobblestone = "/images/cobblestone.png";
private Image image;
public Cobblestone() {
ImageIcon ii = new...
Yes, exactly. I don't know where I have gone wrong with the cobblestone image drawing though.
Sorry, I meant my class which CONTAINS and image. The following is person.java
package outrun;
import java.awt.Image;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
I understand more now but it is still a tad bit hazy. How do I alter my Cobblestone Class so that it IS an image? I am a bit confused as it worked perfectly fine for my other class which is an image....
This is where I'm creating my image:
private String cobblestone = "/images/cobblestone.png";
private Image image;
public Cobblestone() {
ImageIcon ii = new...
Ah ok, sorry that will be much easier:
g2.drawImage(cobblestone, currentX, currentY,this);
This code belongs to Board.class
Error Message: The method drawImage(Image, int, int,...
Yes, it has a method that returns an image for getImage(). I renamed getImage() to drawImage() but the error is still there. Is there something still wrong with the way I have drawn the image or...
Thanks Giggas! I understand now. I have taken both your ideas and altered it to suit my situation. Now however, when I try to compile and run the program the images do not show. I think it must be an...
Thanks so much for your reply aussiemcgr, I have a greater understanding of what I need to do. I still do not understand however what 'maxX' and 'maxY' are representing exactly. Please can you expand...
Hey Everyone :)
So I am basically creating a simple 2D game which will consist of a maze/level. I need to print out multiple images without having to print out the same line hundreds of times...