| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- // Learn cc.Class:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
- // Learn Attribute:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
- cc.Class({
- extends: cc.Component,
- properties: {
- // foo: {
- // // ATTRIBUTES:
- // default: null, // The default value will be used only when the component attaching
- // // to a node for the first time
- // type: cc.SpriteFrame, // optional, default is typeof default
- // serializable: true, // optional, default is true
- // },
- // bar: {
- // get () {
- // return this._bar;
- // },
- // set (value) {
- // this._bar = value;
- // }
- // },
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad () {
- // Log.info("现在有没有",Games)
- Games.setStartLishen(function () {
- // Log.info("应该会掉到了吧",Games)
- tip.tiplayoutc.playIn();
- }.bind(this))
- tip.setTaskChangeLishen(function (task) {
- Log.info("现在任务索引进行了改变",task)
- switch (task) {
- case 2:
- this.shows(0,task);
- break;
- case 3:
- this.shows(1,task);
- break;
- case 4:
- this.shows(2,task);
- break;
- case 5:
- this.shows(1,task);
- break;
- case 6:
- spotlamp.setPandShowAll(false);
- this.shows(3,task);
- break;
- case 7:
- spotlamp.setPandShowAll(false);
- this.shows(4,task);
- break;
- }
- //教程结束
- if (task == 8) {
- tip.tipendc.myShow();
- spotlamp.setPandShowAll(false);
- }
- }.bind(this));
- Games.setBeAttackedLishen(function () {
- spotlamp.setPandShowAll(false);
- }.bind(this));
- },
- shows(index,task){
- if (task == 5) {
- Games.随机生成ZD(index,Games.我方,app.myDishuPool);
- spotlamp.setPandShow(index,true);
- return
- }
- if (index >= 3) {
- spotlamp.setPandShow(index,true);
- return
- }
- Games.随机生成(index,Games.我方,app.myDishuPool);
- spotlamp.setPandShow(index,true);
- },
- start () {
- },
- // update (dt) {},
- });
|