我正在编写 HTML5 游戏,我完全按照教程进行,但出现错误“未捕获的类型错误:对象不是函数”。任何人都可以帮助我吗?
var amplitude = 150;
var period = 2000;
animation = new Kinetic.Animation({
// ERROR APPEARS HERE
func: function (frame)
{
hook.setY(amplitude * Math.sin(frame.time * 2 * Math.PI / period));
hook.setX(fisherGroup.getX());
},
node: shapesLayer
});
fisherGroup.on("mousedown", function(){
animation.start();
});
我创建了:hook = new Kinetic.Image()
及fisherGroup = new Kinetic.Group()
以上这一段。