Hello, I have a question. I want to change a picture from one class to another. I have read on this site that you can do something for this. It is as follows:
I only have a problem because in my own program I want to change the picture several times by using a variable. But that doesn't work, the picture only changes once. Is this because of the get(0) (I don't know what this does) or does it have another reason?
Here is my code:
movement1 and Remove are codes I made in another superclass.
Boat boat = (Boat) getWorld().getObjects(Boat.class).get(0); Boat.setImage("1fish.gif");
movement1(); if ( isTouching(Banana.class) ) { i++; Apple a = (Apple) getWorld().getObjects(Apple.class).get(0); a.setImage("Apple" + i + ".png"); } Remove();