1.循环播放动画
// 物体放缩
var toBig = cc.scaleTo(0.8, 0.9);
var toSmall = cc.scaleTo(0.8, 0.7);
this.exGoldButton.runAction(cc.repeatForever(cc.sequence(toBig, toSmall)));
//箭头平移
let stPos = new cc.Vec2(-100, 80);
let edPos = new cc.Vec2(-20, -30)
let time = 0.8;
this.YinDaoShouZhi.setPosition(stPos);
let action = cc.moveTo(time, edPos);
let repeat = cc.sequence(action, cc.place(stPos))
this.YinDaoShouZhi.stopAllActions();
this.YinDaoShouZhi.runAction(cc.repeatForever(repeat));
2.播放问号动画
let toBig = cc.scaleTo(0.25, 1.05);
let toSmall = cc.scaleTo(0.25, 0.8);
let toNormal = cc.scaleTo(0.2, 1);
let toBig1 = cc.scaleTo(0.25, 1.05);
let toSmall1 = cc.scaleTo(0.25, 0.8);
let toNormal1 = cc.scaleTo(0.2, 1);
this.helpBtn.runAction(cc.sequence(toBig, toSmall, toNormal, toBig1, toSmall1, toNormal1, cc.callFunc(() => {
this.errCount++;
})));
3.项目相关:
// 分享审核
const WXFeedBack = require('WXFeedBack');
const WXGameClub = require('WXGameClub');
WXFeedBack.showFeedBackButton();
WXGameClub.showGameClubButton();
WXGameClub.hideGameClubButton();
WXFeedBack.hideFeedBackButton();
const Share = require("Share")
Share.initMsg();
share() {
let obj = {
title: "能闯过100关,你的成语储备已经超过80%!",
imageUrl: "http://weixin.gzfingertip.cn/wegame/sharepic/cyqwp0628.jpg",
regularTime: 0,
isAds: false,
}
Share.shareGameMsg(obj);
}
Comm_Platform
Comm_Platform.creatBanner(false, this.bannerNode, 'CYBC', 'banner1');
Comm_Platform.hideBanner();
播发视频:
Comm_Platform.showVideoAds({
sucessVedio: () => {},
failVedio: () => { },
successShare: () => { },
failShare: () => { }
})
初始化:
Comm_Platform.init('CYBC', 'CYBC_STAT');
import Comm_Log from "./Comm_Log";
import Comm_Main from "../Comm_Main";
const CCGlobal = require('CCGlobal');
const CCConst = require('CCConst');
const Stat = require("Statistics");
const Ads = require('AdsFunc');
const Share = require('Share');
const QQRank = require("QQrank");
interface VideoCallBack {
pos?: string,
successShare: Function,
sucessVedio: Function,
failShare: Function,
failVedio: Function,
};
/**
* 通用平台组件
*/
class Comm_Platform {
private constructor() { };
private static instance: Comm_Platform = null;
public static getInstance(): Comm_Platform {
this.instance = this.instance || new Comm_Platform();
return this.instance;
};
private AudioPlayer = null;
private _gameKey: string = ''; // 玩法key值
private _statName: string = ''; // 统计时使用的游戏名
private _api: any = null; // sdk
private _isInit: boolean = false; // 初始化
private _networkState: boolean = false; //