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 anima=new Animation();
Player player;
player=new Player(anim);//报错,未定义Player(Animation)
}请问是什么原因,谢谢指点。
{
...
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 anima=new Animation();
Player player;
player=new Player(anim);//报错,未定义Player(Animation)
}请问是什么原因,谢谢指点。
Animation anima=new Animation();
player=new Player(anim);
{
...
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对象????
不知道这是什么原因,谁能告诉我怎么修改?