【发布时间】:2013-01-23 07:59:31
【问题描述】:
我正在编写 HTML5 游戏,我完全按照教程进行,但出现错误“Uncaught TypeError: Object is not a function”。谁能帮帮我?
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()。
【问题讨论】:
-
func: 在函数之前是必须的吗?为什么我觉得这不正确?