The problem is where you are using an instance of the Cobblestone class in the drawImage() method. That is where you need to call the Cobblestone class's getImage() method.
Look at where you are...
Type: Posts; User: Norm
The problem is where you are using an instance of the Cobblestone class in the drawImage() method. That is where you need to call the Cobblestone class's getImage() method.
Look at where you are...
Can you explain why you call the getImage() method of the Person class, but won't call the getImage() method of the Cobblestone class?
Where do you call the Cobblestone class's getImage() method?
m.drawImage(person.getImage(), person.getX(), person.getY(), this);
Is this where the image is being drawn?
That could be very hard. You would need to define the methods in the Image class.
Why do you want to make it an Image? Where do you want to use instances of the class that absolutely require it to...
The compiler wants you to code a variable name in the Graphics class's drawImage() method that has a data type of Image. Cobblestone is NOT an Image. IThe Cobblestone class has a getImage() method...
Is g2 a Graphics object?
If it is, then is cobblestone an Image object? It must be, the drawImage() method requires an Image.
Replace cobblestone with a reference to an Image object.
Where is...
Please post the full text of the error message and the source code causing it.
The Graphics class's drawImage() requires an Image, not a Cobblestone object.
The compiler is looking for an Image as the first argument to drawImage(). It is finding a Cobblestone object which is not an Image.
Does the Cobblestone class have a method that returns an Image?...