繁体   English   中英

Uncaught TypeError:使用ig.AnimationSheet时undefined不是函数

[英]Uncaught TypeError: undefined is not a function when using ig.AnimationSheet

我现在正在使用Impactjs编写游戏,并且一段时间以来我一直在努力解决这个问题。 当我尝试初始化动画表时,在我的player.js文件中收到Uncaught TypeError。 错误位于最后一行。

EntityPlayer = ig.Entity.extend({   
    size: {x:32,y:48},  
    health: 200,
    animSheet: new ig.AnimationSheet( 'media/player.png', 32 , 48 ),

我的.requires看起来像这样:

.requires(  
    'impact.entity',    
    'impact.animation' 
 )

由于构造函数ig.AnimationSheet是该行上的唯一函数,因此我认为它不会被识别。 但这使我感到困惑,因为我虽然Impact.animation是正确的位置。

您不需要导入'impact.animation'它包含在实体中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM