My aim is, to have more than one level in a game. I want to use the same actor "Fels" with different images in the different worlds.
Here is the beginning of my procject:
World
-> BeuteltierWelt
-> IceWorld
Actor
-> Fels
Within the constructor of the class "Fels" i wrote:
The identification of the calling world doesn´t work. I always see "water".
How to write the correct code
greetings from tollpatch
public void Fels()
World hier = this.world();
if ( hier == BeuteltierWelt)
{ setImage (sandrock.png);}
else
if (hier == IceWorld)
{ setImage(icerock.png);}
else
{ setImage( water.png);}
