Commit 11597950 authored by zhangjinzhou's avatar zhangjinzhou

调整游戏实现0914暂存

parent 608d2d6c
......@@ -29,10 +29,10 @@ export default class SceneCtrl {
// console.log("sceneCtrl------change",type,data,onComplete);
if(type==ModuleTypes.MAIN_SCENE){//游戏页
// console.log("游戏界面单例处理");
if(this.mainscene){
// console.log("使用已存在mainscene");
this.showAfterLoadAtlas(this.mainscene,data,onComplete);
}else{
// if(this.mainscene){
// // console.log("使用已存在mainscene");
// this.showAfterLoadAtlas(this.mainscene,data,onComplete);
// }else{
// console.log("第一次创建mainscene");
this.mainscene = new MainScene();
if (!window['development']) {
......@@ -46,7 +46,7 @@ export default class SceneCtrl {
} else {
this.showAfterLoadAtlas(this.mainscene, data, onComplete);
}
}
// }
}
else if(type==ModuleTypes.MAP_SCENE){//mapscene
if(this.mapscene){
......
import getResPath from "../../libs/new_tc/getResPath";
export const baseScore = 20;
export default class gamePool {
//加载器
static svgaParser = new window["SVGA"].Parser();
//三个toast和bonusTime
static movieClips: any = {};
static cannoblockdata: any = null;
static cannomvdata: any = null;
static cannofire1mvdata: any = null;
static cannolightmvdata: any = null;
static cannoparticlemvdata: any = null;
static pongomvdata: any = null;
static pongolfootdata: any = null;
static pongorfootdata: any = null;
static pongojiodata: any = null;
static pongojioArr: Array<any> = [];
static wormlightdata: any = null;
static wormlightArr: Array<any> = [];
//草坪的特效
static lawndata: any = null;
static lawnArr: Array<any> = [];
static dangaodata: any = null;
static regoudata: any = null;
static tiantianquandata: any = null;
static xugaodata: any = null;
//樱花
static cherryAniData: any = {};
static cherryAniArr: any = {};
}
\ No newline at end of file
......@@ -124,6 +124,7 @@ import { Grass } from '../something/class/Grass';
import Food from '../something/class/Food';
import foodAni from '../something/anis/foodAni';
import shuzhi from '../something/class/shuzhi';
import gamePool from '../configData/gamePool';
const aniClass = {
"BoomAni": BoomAni,
......@@ -163,38 +164,38 @@ export const effectBaseTimes = {
MM: 50
};
//加载器
let svgaParser;
// let svgaParser;
//三个toast和bonusTime
const movieClips: any = {};
let cannoblockdata:any = null;
let cannomvdata:any = null;
let cannofire1mvdata:any = null;
let cannolightmvdata:any = null;
let cannoparticlemvdata:any = null;
let pongomvdata:any = null;
let pongolfootdata:any = null;
let pongorfootdata:any = null;
let pongojiodata:any = null;
let pongojioArr:Array<any> = [];
let wormlightdata:any = null;
let wormlightArr:Array<any> = [];
// const movieClips: any = {};
// let cannoblockdata:any = null;
// let cannomvdata:any = null;
// let cannofire1mvdata:any = null;
// let cannolightmvdata:any = null;
// let cannoparticlemvdata:any = null;
// let pongomvdata:any = null;
// let pongolfootdata:any = null;
// let pongorfootdata:any = null;
// let pongojiodata:any = null;
// let pongojioArr:Array<any> = [];
// let wormlightdata:any = null;
// let wormlightArr:Array<any> = [];
//草坪的特效
let lawndata:any = null;
let lawnArr:Array<any> = [];
// let lawndata:any = null;
// let lawnArr:Array<any> = [];
//红包炸弹弹框名字
const redBombPanelName = "RedBombAlert";
let dangaodata:any = null;
let regoudata:any = null;
let tiantianquandata:any = null;
let xugaodata:any = null;
// let dangaodata:any = null;
// let regoudata:any = null;
// let tiantianquandata:any = null;
// let xugaodata:any = null;
//樱花
let cherryAniData:any = {};
let cherryAniArr:any = {};
// let cherryAniData:any = {};
// let cherryAniArr:any = {};
//所有可能被添加节日红包的关卡及索引,默认索引值都是40;如果没有就不放
const fesChapterData: number[] = [];
......@@ -709,16 +710,16 @@ export default class MainScene extends Scene {
*/
initSvgas() {
var resPath = getResPath();
if(!svgaParser) svgaParser = new window["SVGA"].Parser();
// if(!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful", "bonusTime"];
//如果有节日的加
if (this.festivalTarget) svgas.push("redBombLight");
for (let i = 0; i < svgas.length; i++) {
if (movieClips[svgas[i]]) continue;
if (gamePool.movieClips[svgas[i]]) continue;
let mvname = svgas[i];
svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.lockStep = true;
if (svgas[i] != "bonusTime") {
......@@ -727,7 +728,7 @@ export default class MainScene extends Scene {
}
mv.stop();
movieClips[svgas[i]] = mv;
gamePool.movieClips[svgas[i]] = mv;
let fun;
mv.addEventListener(egret.Event.COMPLETE, fun = function(e) {
e.target.stop()
......@@ -742,20 +743,20 @@ export default class MainScene extends Scene {
//炮台的动画数据
if(cannomvdata){
if(gamePool.cannomvdata){
}else{
svgaParser.load(resPath + 'resource/assets/svgas/canno1.svga',(videoItem)=>{
cannomvdata = videoItem;
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/canno1.svga',(videoItem)=>{
gamePool.cannomvdata = videoItem;
})
}
//炮台石头
if(cannoblockdata){
if(gamePool.cannoblockdata){
}else{
svgaParser.load(resPath + 'resource/assets/svgas/cannoblock.svga',(videoItem)=>{
cannoblockdata = videoItem;
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/cannoblock.svga',(videoItem)=>{
gamePool.cannoblockdata = videoItem;
})
}
}
......@@ -764,7 +765,7 @@ export default class MainScene extends Scene {
*/
initCannoSvgas(icanno:Element,icannobianhao:number){
var resPath = getResPath();
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["cannofire1","cannolight"];//,"cannoparticle"];//新增大炮的动画
let icannoidx = icanno.index;
let icannodir:forwardDirection = icanno._cannoDir;
......@@ -795,13 +796,13 @@ export default class MainScene extends Scene {
let mvdata:any;
let mv:any;
if(jsvgname=="cannofire1"){
mvdata = cannofire1mvdata;
mvdata = gamePool.cannofire1mvdata;
mv = Pool.takeOut(RecoverName.CANNOFIRE);
}else if(jsvgname=="cannolight"){
mvdata = cannolightmvdata;
mvdata = gamePool.cannolightmvdata;
mv = Pool.takeOut(RecoverName.CANNOLIGHT);
}else if(jsvgname=="cannoparticle"){
mvdata = cannoparticlemvdata;
mvdata = gamePool.cannoparticlemvdata;
}
if(mvdata){
if(!mv){
......@@ -810,15 +811,15 @@ export default class MainScene extends Scene {
}
this.initCannoMv(mv,jsvgname,icannobianhao);
}else{
svgaParser.load(resPath + 'resource/assets/svgas/' + jsvgname + ".svga", (videoItem) => {
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/' + jsvgname + ".svga", (videoItem) => {
let mv = new window["SVGA"].EgretMovieClip(videoItem);
// mv.lockStep = true;
if(jsvgname=="cannofire1"&&!cannofire1mvdata){
cannofire1mvdata = videoItem;
}else if(jsvgname=="cannolight"&&!cannolightmvdata){
cannolightmvdata = videoItem;
}else if(jsvgname=="cannoparticle"&&!cannoparticlemvdata){
cannoparticlemvdata = videoItem;
if(jsvgname=="cannofire1"&&!gamePool.cannofire1mvdata){
gamePool.cannofire1mvdata = videoItem;
}else if(jsvgname=="cannolight"&&!gamePool.cannolightmvdata){
gamePool.cannolightmvdata = videoItem;
}else if(jsvgname=="cannoparticle"&&!gamePool.cannoparticlemvdata){
gamePool.cannoparticlemvdata = videoItem;
}
this.initCannoMv(mv,jsvgname,icannobianhao);
},function(error){
......@@ -833,13 +834,13 @@ export default class MainScene extends Scene {
*/
initWormSvgas(){
var resPath = getResPath();
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
if(wormlightdata){
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
if(gamePool.wormlightdata){
}else{
svgaParser.load(resPath + 'resource/assets/svgas/wormholelight.svga', (videoItem) => {
if(!wormlightdata){
wormlightdata = videoItem;
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/wormholelight.svga', (videoItem) => {
if(!gamePool.wormlightdata){
gamePool.wormlightdata = videoItem;
}
})
}
......@@ -847,13 +848,13 @@ export default class MainScene extends Scene {
//草坪动画
initLawn(call=null){
var resPath = getResPath();
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
if(lawndata){
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
if(gamePool.lawndata){
}else{
svgaParser.load(resPath + 'resource/assets/svgas/lawn.svga', (videoItem) => {
if(!lawndata){
lawndata = videoItem;
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/lawn.svga', (videoItem) => {
if(!gamePool.lawndata){
gamePool.lawndata = videoItem;
}
})
}
......@@ -862,12 +863,12 @@ export default class MainScene extends Scene {
* 加载猩猩脚印
*/
initPongoJioSvgas(call:any=null){
if(pongojiodata){
if(gamePool.pongojiodata){
}else{
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/xingxingjio.svga', (videoItem) => {
pongojiodata = videoItem;
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/xingxingjio.svga', (videoItem) => {
gamePool.pongojiodata = videoItem;
call&&call();
})
}
......@@ -1577,15 +1578,15 @@ export default class MainScene extends Scene {
canno.resetToCannoView(dirType,this);
let cannobianhao:number = this.cannonums;
//添加大炮
if(cannomvdata){
canno.createCanno(cannomvdata,cannobianhao);
if(gamePool.cannomvdata){
canno.createCanno(gamePool.cannomvdata,cannobianhao);
}else{
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/canno1.svga',(videoItem)=>{
if(!cannomvdata){
cannomvdata = videoItem;
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/canno1.svga',(videoItem)=>{
if(!gamePool.cannomvdata){
gamePool.cannomvdata = videoItem;
}
canno.createCanno(cannomvdata,cannobianhao);
canno.createCanno(gamePool.cannomvdata,cannobianhao);
})
}
this.cannonums += 1;
......@@ -1615,15 +1616,15 @@ export default class MainScene extends Scene {
pongo.setPongoPart(inpart);
this.lattices[i].element = pongo;
if(inpart=="tl"){
if(pongomvdata&&pongolfootdata&&pongorfootdata){
if(gamePool.pongomvdata&&gamePool.pongolfootdata&&gamePool.pongorfootdata){
this.waitDataCreatePongo(pongo);
}else{
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["xingxing","leftxingxing","rightxingxing"];
for(let pg=0;pg<svgas.length;pg++){
let pgname = svgas[pg];
if(pgname=="xingxing"){
if(pongomvdata){
if(gamePool.pongomvdata){
var iscreate = this.waitDataCreatePongo(pongo);
if(iscreate){
break;
......@@ -1632,7 +1633,7 @@ export default class MainScene extends Scene {
}
}
}else if(pgname=="leftxingxing"){
if(pongolfootdata){
if(gamePool.pongolfootdata){
var iscreate = this.waitDataCreatePongo(pongo);
if(iscreate){
break;
......@@ -1641,7 +1642,7 @@ export default class MainScene extends Scene {
}
}
}else if(pgname=="rightxingxing"){
if(pongorfootdata){
if(gamePool.pongorfootdata){
var iscreate = this.waitDataCreatePongo(pongo);
if(iscreate){
break;
......@@ -1651,18 +1652,18 @@ export default class MainScene extends Scene {
}
}
svgaParser.load(resPath + 'resource/assets/svgas/'+pgname+'.svga',(videoItem)=>{
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/'+pgname+'.svga',(videoItem)=>{
if(pgname=="xingxing"){
if(!pongomvdata){
pongomvdata = videoItem;
if(!gamePool.pongomvdata){
gamePool.pongomvdata = videoItem;
}
}else if(pgname=="leftxingxing"){
if(!pongolfootdata){
pongolfootdata = videoItem;
if(!gamePool.pongolfootdata){
gamePool.pongolfootdata = videoItem;
}
}else if(pgname=="rightxingxing"){
if(!pongorfootdata){
pongorfootdata = videoItem;
if(!gamePool.pongorfootdata){
gamePool.pongorfootdata = videoItem;
}
}
......@@ -1697,8 +1698,8 @@ export default class MainScene extends Scene {
havecreate:Array<number> = [];
//创建猩猩
waitDataCreatePongo(pongo:Element){
if(pongomvdata&&pongolfootdata&&pongorfootdata){
pongo.createPongo(pongomvdata,pongolfootdata,pongorfootdata);
if(gamePool.pongomvdata&&gamePool.pongolfootdata&&gamePool.pongorfootdata){
pongo.createPongo(gamePool.pongomvdata,gamePool.pongolfootdata,gamePool.pongorfootdata);
return true;
}else{
return false;
......@@ -1853,6 +1854,7 @@ export default class MainScene extends Scene {
//侦听事件
initEvents() {
console.error("加入事件监听233=====");
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this)
this.questionBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
......@@ -1879,6 +1881,7 @@ export default class MainScene extends Scene {
removeEvents() {
console.error("移除事件监听233====");
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this);
this.questionBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
......@@ -1918,6 +1921,8 @@ export default class MainScene extends Scene {
Pool.recover(RecoverName.CANNOLIGHT,icannoeffectlight);
}
}
//回收格子
this.cannoEffect = new Array();
}
destroy() {
......@@ -3538,17 +3543,17 @@ export default class MainScene extends Scene {
//连消基数为1
this.commonContinuityTimes = 1;
this.effectContinuityTimes = 1;
if(movieClips["bonusTime"]) {
if(gamePool.movieClips["bonusTime"]) {
playSound(SoundType.bonusTime);
let rect = new Rect(750, 1624, 0x000000);
rect.alpha = 0.6;
this.addChild(rect);
this.addChild(movieClips["bonusTime"])
movieClips["bonusTime"].gotoAndPlay(1, true)
this.addChild(gamePool.movieClips["bonusTime"])
gamePool.movieClips["bonusTime"].gotoAndPlay(1, true)
setTimeout(() => {
this.terminateSteps();
if(movieClips["bonusTime"].parent) {
this.removeChild(movieClips["bonusTime"])
if(gamePool.movieClips["bonusTime"].parent) {
this.removeChild(gamePool.movieClips["bonusTime"])
}
if(rect.parent){
this.removeChild(rect);
......@@ -5022,12 +5027,12 @@ export default class MainScene extends Scene {
playSound(SoundType.toast);
sv = "great";
}
if(sv && movieClips[sv]) {
this.effectContainer.addChild(movieClips[sv])
movieClips[sv].gotoAndPlay(1, true)
if(sv && gamePool.movieClips[sv]) {
this.effectContainer.addChild(gamePool.movieClips[sv])
gamePool.movieClips[sv].gotoAndPlay(1, true)
setTimeout(() => {
if(movieClips[sv].parent) {
this.effectContainer.removeChild(movieClips[sv])
if(gamePool.movieClips[sv].parent) {
this.effectContainer.removeChild(gamePool.movieClips[sv])
}
}, 667)
}
......@@ -5700,12 +5705,12 @@ export default class MainScene extends Scene {
var pos = Tool.getPositionByIndex(ikuang);
var kuangpos = this.elementContainer.localToGlobal(pos[0],pos[1]);
if(pongojiodata){
if(gamePool.pongojiodata){
let ikuangmv;
if(pongojioArr.length>0){
ikuangmv = pongojioArr.shift();
if(gamePool.pongojioArr.length>0){
ikuangmv = gamePool.pongojioArr.shift();
}else{
ikuangmv = new window["SVGA"].EgretMovieClip(pongojiodata);
ikuangmv = new window["SVGA"].EgretMovieClip(gamePool.pongojiodata);
}
ikuangmv.addEventListener(egret.Event.COMPLETE,this.playCompleteJio,this);
this.effectContainer.addChild(ikuangmv);
......@@ -5716,10 +5721,10 @@ export default class MainScene extends Scene {
console.error("无猩猩脚印data,一般不用处理");
this.initPongoJioSvgas(function(){
let ikuangmv;
if(pongojioArr.length>0){
ikuangmv = pongojioArr.shift();
if(gamePool.pongojioArr.length>0){
ikuangmv = gamePool.pongojioArr.shift();
}else{
ikuangmv = new window["SVGA"].EgretMovieClip(pongojiodata);
ikuangmv = new window["SVGA"].EgretMovieClip(gamePool.pongojiodata);
}
ikuangmv.addEventListener(egret.Event.COMPLETE,this.playCompleteJio,this);
this.effectContainer.addChild(ikuangmv);
......@@ -5739,7 +5744,7 @@ export default class MainScene extends Scene {
target.removeEventListener(egret.Event.COMPLETE,this.playCompleteJio,this);
if(target.parent){
target.parent.removeChild(target);
pongojioArr.push(target);
gamePool.pongojioArr.push(target);
}
}
......@@ -5907,7 +5912,7 @@ export default class MainScene extends Scene {
//炮台石头的动效
var blockmv = Pool.takeOut(RecoverName.CANNOBLOCKANI);//movieClips["cannoblock"];
if(!blockmv){
blockmv = new window["SVGA"].EgretMovieClip(cannoblockdata);
blockmv = new window["SVGA"].EgretMovieClip(gamePool.cannoblockdata);
}else{
// console.log("复用炮台石头");
}
......@@ -5983,15 +5988,15 @@ export default class MainScene extends Scene {
//红包炸弹动效
redBombLightAni(index: number, callback: Function) {
//如果有
if(movieClips["redBombLight"]) {
if(gamePool.movieClips["redBombLight"]) {
var p = Tool.getPositionByIndex(index);
movieClips["redBombLight"].x = p[0] - 358;
movieClips["redBombLight"].y = p[1] - 137;
this.effectContainer.addChild(movieClips["redBombLight"])
movieClips["redBombLight"].gotoAndPlay(1, true);
gamePool.movieClips["redBombLight"].x = p[0] - 358;
gamePool.movieClips["redBombLight"].y = p[1] - 137;
this.effectContainer.addChild(gamePool.movieClips["redBombLight"])
gamePool.movieClips["redBombLight"].gotoAndPlay(1, true);
setTimeout(() => {
if(movieClips["redBombLight"].parent) {
movieClips["redBombLight"].parent.removeChild(movieClips["redBombLight"])
if(gamePool.movieClips["redBombLight"].parent) {
gamePool.movieClips["redBombLight"].parent.removeChild(gamePool.movieClips["redBombLight"])
}
}, 56 / 60 * 1000)
}
......@@ -6385,10 +6390,10 @@ export default class MainScene extends Scene {
//黑洞星星动画
wormlightAnm(posx,posy){
let onewormlight;
if(wormlightArr.length>0){
onewormlight = wormlightArr.shift();
if(gamePool.wormlightArr.length>0){
onewormlight = gamePool.wormlightArr.shift();
}else{
onewormlight = new window["SVGA"].EgretMovieClip(wormlightdata);
onewormlight = new window["SVGA"].EgretMovieClip(gamePool.wormlightdata);
}
this.effectContainer.addChild(onewormlight);
// console.log(onewormlight);
......@@ -6412,7 +6417,7 @@ export default class MainScene extends Scene {
onewormlight.gotoAndStop(1);
if(onewormlight.parent){
onewormlight.parent.removeChild(onewormlight);
wormlightArr.push(onewormlight);
gamePool.wormlightArr.push(onewormlight);
}
}
......@@ -6532,10 +6537,10 @@ export default class MainScene extends Scene {
lawnAnm(posx,posy,grass:any,grassp:any,passpos:Array<number>,index:number){
var pro = new Promise((resolve)=>{
let onelawn;
if(lawnArr.length>0){
onelawn = lawnArr.shift();
if(gamePool.lawnArr.length>0){
onelawn = gamePool.lawnArr.shift();
}else{
onelawn = new window["SVGA"].EgretMovieClip(lawndata);
onelawn = new window["SVGA"].EgretMovieClip(gamePool.lawndata);
}
this.effectContainer.addChild(onelawn);
onelawn.x = posx-80;
......@@ -6547,7 +6552,7 @@ export default class MainScene extends Scene {
onelawn.gotoAndStop(1);
if(onelawn.parent){
onelawn.parent.removeChild(onelawn);
lawnArr.push(onelawn);
gamePool.lawnArr.push(onelawn);
}
}
onelawn.addEventListener(egret.Event.COMPLETE,compfunc);
......@@ -7342,16 +7347,16 @@ export default class MainScene extends Scene {
var cutx:number = foodsize[0];
var cuty:number = foodsize[1];
if(type==ElementType.food1){
mv = new window["SVGA"].EgretMovieClip(xugaodata);
mv = new window["SVGA"].EgretMovieClip(gamePool.xugaodata);
}else if(type==ElementType.food2){
mv = new window["SVGA"].EgretMovieClip(dangaodata);
mv = new window["SVGA"].EgretMovieClip(gamePool.dangaodata);
}else if(type==ElementType.food3){
mv = new window["SVGA"].EgretMovieClip(tiantianquandata);
mv = new window["SVGA"].EgretMovieClip(gamePool.tiantianquandata);
}else if(type==ElementType.food4){
mv = new window["SVGA"].EgretMovieClip(regoudata);
mv = new window["SVGA"].EgretMovieClip(gamePool.regoudata);
}
mv.stop();
......@@ -7463,19 +7468,19 @@ export default class MainScene extends Scene {
//加载食物动画
initFoodSvgas(){
var resPath = getResPath();
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var foodarr = ["dangao","regou","tiantianquan","xugao"];
for(let i=0;i<foodarr.length;i++){
let ifood = foodarr[i];
svgaParser.load(resPath + 'resource/assets/svgas/'+ifood+'.svga', (videoItem) => {
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/'+ifood+'.svga', (videoItem) => {
if(ifood=="dangao"){
dangaodata = videoItem;
gamePool.dangaodata = videoItem;
}else if(ifood=="regou"){
regoudata = videoItem;
gamePool.regoudata = videoItem;
}else if(ifood=="tiantianquan"){
tiantianquandata = videoItem;
gamePool.tiantianquandata = videoItem;
}else if(ifood=="xugao"){
xugaodata = videoItem;
gamePool.xugaodata = videoItem;
}
})
}
......@@ -7510,10 +7515,10 @@ export default class MainScene extends Scene {
var cherryArr:Array<string> = ["cherry1_2","cherry2_3","cherry3_4","cherry4_5","cherry5_6"];
for(let i=0;i<cherryArr.length;i++){
let icherryname = cherryArr[i];
if(!cherryAniData[icherryname]){
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/'+icherryname+'.svga', (videoItem) => {
cherryAniData[icherryname] = videoItem;
if(!gamePool.cherryAniData[icherryname]){
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
gamePool.svgaParser.load(resPath + 'resource/assets/svgas/'+icherryname+'.svga', (videoItem) => {
gamePool.cherryAniData[icherryname] = videoItem;
})
}
}
......@@ -7754,19 +7759,19 @@ export default class MainScene extends Scene {
if(lastani){
let lastoname = lastani["oname"];
this.effectContainer.removeChild(lastani);
cherryAniArr[lastoname].push(lastani);
gamePool.cherryAniArr[lastoname].push(lastani);
}
let oneani:any;
let aniname = "cherry"+statold+"_"+statnew;
if(!cherryAniArr[aniname]){
cherryAniArr[aniname] = new Array();
if(!gamePool.cherryAniArr[aniname]){
gamePool.cherryAniArr[aniname] = new Array();
}
if(cherryAniArr.length>0){
oneani = cherryAniArr.shift();
if(gamePool.cherryAniArr.length>0){
oneani = gamePool.cherryAniArr.shift();
}else{
oneani = new window["SVGA"].EgretMovieClip(cherryAniData[aniname]);
oneani = new window["SVGA"].EgretMovieClip(gamePool.cherryAniData[aniname]);
}
let p = Tool.getPositionByIndex(idx);
......@@ -7822,7 +7827,7 @@ export default class MainScene extends Scene {
if(isfina){
//移除樱花动画
this.effectContainer.removeChild(oneani);
cherryAniArr[aniname].push(oneani);
gamePool.cherryAniArr[aniname].push(oneani);
}
}
oneani.addEventListener(egret.Event.ENTER_FRAME,framefunc,this);
......@@ -7947,6 +7952,5 @@ export default class MainScene extends Scene {
}
return amove;
}
//一般
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment