| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- // 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 () {
- utils.isMobile(function () {
- manager_android_js.strike = this;
- }.bind(this));
- this.left = UtilsNode.getNode("left",this.node);
- this.mid = UtilsNode.getNode("mid",this.node);
- this.right = UtilsNode.getNode("right",this.node);
- utils.isMobile(function () {
- this.node.active = false;
- }.bind(this));
- UtilsNode.setOn(this.left,function () {
- let data = {
- der: 1,
- pianyi: 50,
- power: 40,
- ballSpeed: 20,
- kitTime: 20,
- ATime: 20
- }
- this.getMyDishuPoolfortype(0,data);
- }.bind(this));
- UtilsNode.setOn(this.mid,function () {
- let data = {
- der: 4,
- pianyi: 50,
- power: 40,
- ballSpeed: 20,
- kitTime: 20,
- ATime: 20
- }
- this.getMyDishuPoolfortype(1,data);
- }.bind(this));
- UtilsNode.setOn(this.right,function () {
- let data = {
- der: 2,
- pianyi: 50,
- power: 40,
- ballSpeed: 20,
- kitTime: 20,
- ATime: 20
- }
- this.getMyDishuPoolfortype(2,data);
- }.bind(this));
- app.myDishuPool = []
- },
- start () {
- },
- strike_dishu : function (data) {
- },
- getMyDishuPoolfortype : function (index,datas) {
- // console.log("当前地鼠 打击", app.myDishuPool,"index ",index);
- // let data = {
- // der: der,
- // pianyi: pianyi,
- // power: power,
- // ballSpeed: ballSpeed,
- // kitTime: kitTime,
- // ATime: ATime
- // }
- UserInfo.PlayerGameData.everypowerdata.push(datas);
- // console.log("当前地鼠 打击", app.myDishuPool,"index ",index);
- if (app.myDishuPool[index] !=null) {
- app.myDishuPool[index].toclick(datas);
- UserInfo.PlayerGameData.everypowerdataOK.push(datas);
- }else{
- Statistics.addmiss(0);
- }
- //显示测试 击打ui
- if (testUI) {
- testUI.showDa(index);
- }
- //
- if (tip) {
- tip.tiplayoutc.daplayOut();
- }
- }
- // update (dt) {},
- });
|