I have one problem in inheriting CCSprites in java, i post some of codes here,
public class Block extends CCSprite
{
stati开发者_Python百科c Block temp=null;
...
...
static Block newBlock(tetrominoTypes blockType)
{
temp = (Block) Block.sprite(filename); // class cast exception here
}
return temp;
}
...... }
Class cast expection occur on runtime , how can i resolve it.If any one knows means help me out.
sprite
seems to be a static function of the mother class.
Maybe try :
temp = (Block) CCSprite.sprite(filename);
精彩评论