123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- const GameModule = require("../utils/GameModule");
- const DWTool = require('../utils/DWTool');
- const TapTapTool = require("../utils/TapTapTool");
- cc.Class({
- extends: cc.Component,
- properties: {
- addRichText: cc.RichText
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad () {
- // this.node.zIndex = this.zIndex;
- // this.addLabel.active = false;
- },
- start () {
- },
- showAddMoney(showFinish, isAuto = false) {
- let money = TapTapTool.parseToString(GameModule.userInfo.coinTap);
- this.addRichText.string = `<b>+${money}</b>`;
- this.node.opacity = 255;
- let upAction = cc.moveBy(0.2, 0, 20);
- let fadeOutAction = cc.fadeOut(0.8);
- let upAction2 = cc.moveBy(0.8, 0, 80);
- let spaw = cc.spawn(fadeOutAction,upAction2);
- let callback = cc.callFunc(() => {
- this.node.active = false;
- if (showFinish) {
- showFinish();
- }
- });
- this.node.runAction(cc.sequence(upAction, spaw, callback));
- GameModule.userInfo.gold = TapTapTool.add(GameModule.userInfo.gold, GameModule.userInfo.coinTap);
- if (!isAuto) {
- GameModule.userInfo.clickCount += 1;
- }
- },
- // update (dt) {},
- });
|