|
楼主 |
发表于 2020-1-26 09:54:01
|
显示全部楼层
public class Sprite
{
...
public Sprite(Animation anim)
{
this.anim=anim;
}
}
public class Player extends Sprite
{
...
public Player(Animation anim) //生成Sprite对象而不是Player对象????
{
super(anim);
state=STATE_NORMAL;
}
}
public class Test
{ Animation anim=new Animation();
Player player;
player=new Player(anim);//报错,未定义Player(Animation)
}
主要是调用Player构造函数生成Sprite对象而不是Player对象????
不知道这是什么原因,谁能告诉我怎么修改? |
|