|
public class Sprite
{
...
public Sprite (Animation anim)
{
this.anim = anim;
}
}
public class Player extends Sprite
{
...
public Player (Animation anim) // Generate a Sprite object instead of a Player object? ? ? ?
{
super (anim);
state = STATE_NORMAL;
}
}
public class Test
{Animation anim = new Animation ();
Player player;
player = new Player (anim); // Error reported, Player (Animation) is not defined
}
Mainly call the Player constructor to generate a Sprite object instead of a Player object? ? ? ?
I don't know what the reason is, can anyone tell me how to modify it? |
|