请问是否有计时器的范例

在页面头上显示X‘XX”XXX 直到gameover

同时请问是放在function里面还是GameLayer里面比较好?

感谢感谢~~~

js的木有找到…

咳。。。新手 this.schedule(UI.timeUp);
this.scheduleUpdate();
不会用啊

下面这段还是失败…

var GameLayer = cc.Layer.extend({
_time:0,
_timeLabel:null,
_timeString:"",
scoreCounter:function () {
this._time++;

        var minute = 0 | (this._time / 60);
        var second = this._time % 60;
        minute = minute > 9 ? minute : "0" + minute;
        second = second > 9 ? second : "0" + second;
        this._timeString = minute + ":" + second;
        this._timeLabel.setString(this._timeString);
},

onEnter: function() {
this._timeLabel = cc.LabelTTF.create(“00:00”,“Arial Bold”,16);
this._timeLabel.setPosition(100,100);
this._timeLabel.setColor(0,255,0);
this.addChild(this._timeLabel,10);
this.scheduleUpdate();
this.schedule(this.scoreCounter, 1);
}
});

搞定了