我按照入门教程里的快速上手做个游戏里的方式在尝试制作,但是我自己想实现些别的东西,于是自己尝试着打了一串脚本,但是我打的方法出现错误。
var player = require (“player”);
cc.Class({
extends: cc.Component,
properties: {
},
runGame:function(){
log("runGame function is comletely run.");
player.node.runstart();
},
onLoad: function () {
log("startbtn onLoad this:"+this.name);
this.node.on('mouseenter',function(event){
log("callfunc this:"+this.name);
this.runAction(cc.scaleTo(0.1,1.2));
});
this.node.on('mouseleave',function(event){
this.runAction(cc.scaleTo(0.1,1));
});
this.node.on('mousedown',function(event){
this.runGame();
})
},
});
之后预览游戏时,出现错误:
Simulator : 145:TypeError: this.runGame is not a function
求高手指点,本人纯新手,卡在这里很长时间了。

