Commit b623a512 authored by Master Q's avatar Master Q

zhen动画

parent 999fd2d6
......@@ -67,9 +67,7 @@
var canvas = document.getElementById("canvas");
canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1)
canvas.height = document.body.clientHeight * (window.devicePixelRatio || 1)
var main = new Main(canvas, {
isNewGuy: true
});
var main = new Main(canvas);
setTimeout(() => {
GDispatcher.dispatchEvent('GAME_START')
}, 1000)
......
......@@ -5,6 +5,7 @@
"main": "index.html",
"devDependencies": {
"ali-oss": "^4.11.4",
"canvas": "^2.9.0",
"chalk": "^2.3.0",
"co": "^4.6.0",
"del": "^2.2.1",
......@@ -26,7 +27,6 @@
"webpack-merge": "^4.1.2"
},
"dependencies": {
"@lightfish/tools": "^1.0.0"
},
"scripts": {
"psd": "node scripts/psdH && node scripts/flushRes",
......
......@@ -5,8 +5,28 @@
"name": "GameScene"
},
{
"keys": "comCloseBtn.png,com_light.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png",
"keys": "comCloseBtn.png,com_light.png,left-arrow.png,right-arrow.png,ruready.png,sceneBack.jpg,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common"
},
{
"keys": "jianyabeidai10.png,jianyabeidai11.png,jianyabeidai110.png,jianyabeidai111.png,jianyabeidai112.png,jianyabeidai113.png,jianyabeidai114.png,jianyabeidai115.png,jianyabeidai116.png,jianyabeidai117.png,jianyabeidai118.png,jianyabeidai119.png,jianyabeidai12.png,jianyabeidai120.png,jianyabeidai121.png,jianyabeidai122.png,jianyabeidai123.png,jianyabeidai124.png,jianyabeidai125.png,jianyabeidai126.png,jianyabeidai127.png,jianyabeidai128.png,jianyabeidai129.png,jianyabeidai13.png,jianyabeidai130.png,jianyabeidai131.png,jianyabeidai132.png,jianyabeidai133.png,jianyabeidai134.png,jianyabeidai135.png,jianyabeidai136.png,jianyabeidai137.png,jianyabeidai138.png,jianyabeidai139.png,jianyabeidai14.png,jianyabeidai140.png,jianyabeidai141.png,jianyabeidai142.png,jianyabeidai143.png,jianyabeidai144.png,jianyabeidai145.png,jianyabeidai146.png,jianyabeidai147.png,jianyabeidai148.png,jianyabeidai15.png,jianyabeidai16.png,jianyabeidai17.png,jianyabeidai18.png,jianyabeidai19.png",
"name": "jianyabeidai1"
},
{
"keys": "naiping10.png,naiping11.png,naiping110.png,naiping111.png,naiping112.png,naiping113.png,naiping114.png,naiping115.png,naiping116.png,naiping117.png,naiping118.png,naiping119.png,naiping12.png,naiping120.png,naiping121.png,naiping122.png,naiping123.png,naiping124.png,naiping125.png,naiping126.png,naiping127.png,naiping128.png,naiping129.png,naiping13.png,naiping130.png,naiping131.png,naiping132.png,naiping133.png,naiping134.png,naiping135.png,naiping136.png,naiping137.png,naiping138.png,naiping139.png,naiping14.png,naiping140.png,naiping141.png,naiping142.png,naiping143.png,naiping144.png,naiping145.png,naiping146.png,naiping147.png,naiping148.png,naiping15.png,naiping16.png,naiping17.png,naiping18.png,naiping19.png",
"name": "naiping1"
},
{
"keys": "penchouwai10.png,penchouwai11.png,penchouwai110.png,penchouwai111.png,penchouwai112.png,penchouwai113.png,penchouwai114.png,penchouwai115.png,penchouwai116.png,penchouwai117.png,penchouwai118.png,penchouwai119.png,penchouwai12.png,penchouwai120.png,penchouwai121.png,penchouwai122.png,penchouwai123.png,penchouwai124.png,penchouwai125.png,penchouwai126.png,penchouwai127.png,penchouwai128.png,penchouwai129.png,penchouwai13.png,penchouwai130.png,penchouwai131.png,penchouwai132.png,penchouwai133.png,penchouwai134.png,penchouwai135.png,penchouwai136.png,penchouwai137.png,penchouwai138.png,penchouwai139.png,penchouwai14.png,penchouwai140.png,penchouwai141.png,penchouwai142.png,penchouwai143.png,penchouwai144.png,penchouwai145.png,penchouwai146.png,penchouwai147.png,penchouwai148.png,penchouwai15.png,penchouwai16.png,penchouwai17.png,penchouwai18.png,penchouwai19.png",
"name": "penchouwai1"
},
{
"keys": "yingerchuang10.png,yingerchuang11.png,yingerchuang110.png,yingerchuang111.png,yingerchuang112.png,yingerchuang113.png,yingerchuang114.png,yingerchuang115.png,yingerchuang116.png,yingerchuang117.png,yingerchuang118.png,yingerchuang119.png,yingerchuang12.png,yingerchuang120.png,yingerchuang121.png,yingerchuang122.png,yingerchuang123.png,yingerchuang124.png,yingerchuang125.png,yingerchuang126.png,yingerchuang127.png,yingerchuang128.png,yingerchuang129.png,yingerchuang13.png,yingerchuang130.png,yingerchuang131.png,yingerchuang132.png,yingerchuang133.png,yingerchuang134.png,yingerchuang135.png,yingerchuang136.png,yingerchuang137.png,yingerchuang138.png,yingerchuang139.png,yingerchuang14.png,yingerchuang140.png,yingerchuang141.png,yingerchuang142.png,yingerchuang143.png,yingerchuang144.png,yingerchuang145.png,yingerchuang146.png,yingerchuang147.png,yingerchuang148.png,yingerchuang15.png,yingerchuang16.png,yingerchuang17.png,yingerchuang18.png,yingerchuang19.png",
"name": "yingerchuang1"
},
{
"keys": "zhiniaoku10.png,zhiniaoku11.png,zhiniaoku110.png,zhiniaoku111.png,zhiniaoku112.png,zhiniaoku113.png,zhiniaoku114.png,zhiniaoku115.png,zhiniaoku116.png,zhiniaoku117.png,zhiniaoku118.png,zhiniaoku119.png,zhiniaoku12.png,zhiniaoku120.png,zhiniaoku121.png,zhiniaoku122.png,zhiniaoku123.png,zhiniaoku124.png,zhiniaoku125.png,zhiniaoku126.png,zhiniaoku127.png,zhiniaoku128.png,zhiniaoku129.png,zhiniaoku13.png,zhiniaoku130.png,zhiniaoku131.png,zhiniaoku132.png,zhiniaoku133.png,zhiniaoku134.png,zhiniaoku135.png,zhiniaoku136.png,zhiniaoku137.png,zhiniaoku138.png,zhiniaoku139.png,zhiniaoku14.png,zhiniaoku140.png,zhiniaoku141.png,zhiniaoku142.png,zhiniaoku143.png,zhiniaoku144.png,zhiniaoku145.png,zhiniaoku146.png,zhiniaoku147.png,zhiniaoku148.png,zhiniaoku15.png,zhiniaoku16.png,zhiniaoku17.png,zhiniaoku18.png,zhiniaoku19.png",
"name": "zhiniaoku1"
}
],
"path": "./resource/"
......
......@@ -9,7 +9,7 @@ var endPath = './released/';
fs.writeFileSync(endPath + "output.js",
// 'import * as FYGE from "fyge-tbmini";\n' +
// 'import * as FYGE from "fyge";\n' +//以后改成这个
'import * as FYGE from "fyge";\n' +//以后改成这个
// 'import * as SvgaParser from "svga-parser";\n' +
fs.readFileSync("./output.js"));
console.log("js生成")
var fs = require("fs");
var path = require('path');
const { createCanvas, loadImage } = require('canvas')
//缩放比率
var scale = 0.5;
//图片的文件夹
var resouceName = "naiping";
var inDir = "./resource/" + resouceName;
//输出导出文件夹
var outDir = "" || inDir + "1";
//生成导出文件夹
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir);
//读文件夹
var files = fs.readdirSync(inDir);
files.forEach(async function (fileName, index) {
//只管图片
if (path.extname(fileName).indexOf(".png") < 0 && path.extname(fileName).indexOf(".jpg") < 0) {
return;
}
//加载图片
const img = await loadImage(fs.readFileSync(inDir + "/" + fileName))
var canvas = createCanvas(img.width * scale, img.height * scale)
var ctx = canvas.getContext("2d");
//绘制
ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);
//保存图片
canvas.createPNGStream().pipe(fs.createWriteStream(outDir + "/" + resouceName +'1' + index + ".png"));
})
\ No newline at end of file
......@@ -9,7 +9,7 @@ import { destroyTbNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
import { SkinJson } from "./SkinJson";
import { G_EVENT } from "./common/G_EVENT";
import { Tools } from "./Tools";
import IndexScene from './scenes/IndexScene';
import { CarouselItems } from "./scenes/CarouselItem";
/**
* 全局事件,为了和小程序交互
......@@ -28,8 +28,6 @@ export class Main {
PAGE && (Tools.PAGE = PAGE);
}
gameSceneInitPromise: Promise<any>;
constructor(canvas: HTMLCanvasElement, PAGE) {
PAGE && (Tools.PAGE = PAGE);
var sysInfo;
......@@ -167,27 +165,8 @@ export class Main {
console.log("通用资源加载完成")
// h5环境时,隐藏加载中
if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
// const baseSuccess = await Tools.getActivityBaseInfo();
// if (!baseSuccess) {
// showToast("获取活动信息失败");
// return;
// }
// const gameSuccess = await Tools.getGameInfo();
// if (!gameSuccess) {
// showToast("获取游戏信息失败");
// return;
// }
let gameSceneInitResolve: any;
this.gameSceneInitPromise = new Promise(r => {
gameSceneInitResolve = r
})
changeScene(IndexScene, {
sceneData: 11,
gameSceneInitResolve: gameSceneInitResolve
});
changeScene(CarouselItems);
}
}
......
......@@ -304,7 +304,7 @@ export const ResJson = {
}
},
{
"keys": "comCloseBtn.png,com_light.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png",
"keys": "comCloseBtn.png,com_light.png,left-arrow.png,right-arrow.png,ruready.png,sceneBack.jpg,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common",
"atlas": {
"com_light.png": {
......@@ -351,9 +351,31 @@ export const ResJson = {
"sh": 38,
"ro": true
},
"comCloseBtn.png": {
"left-arrow.png": {
"x": 750,
"y": 464,
"w": 74,
"h": 118,
"ox": 0,
"oy": 0,
"sw": 74,
"sh": 118,
"ro": true
},
"right-arrow.png": {
"x": 750,
"y": 540,
"w": 73,
"h": 118,
"ox": 0,
"oy": 0,
"sw": 73,
"sh": 118,
"ro": true
},
"comCloseBtn.png": {
"x": 750,
"y": 615,
"w": 72,
"h": 72,
"ox": 0,
......@@ -364,7 +386,7 @@ export const ResJson = {
},
"waitingRot.png": {
"x": 824,
"y": 464,
"y": 615,
"w": 56,
"h": 56,
"ox": 0,
......@@ -374,8 +396,2733 @@ export const ResJson = {
"ro": false
}
}
},
{
"keys": "jianyabeidai10.png,jianyabeidai11.png,jianyabeidai110.png,jianyabeidai111.png,jianyabeidai112.png,jianyabeidai113.png,jianyabeidai114.png,jianyabeidai115.png,jianyabeidai116.png,jianyabeidai117.png,jianyabeidai118.png,jianyabeidai119.png,jianyabeidai12.png,jianyabeidai120.png,jianyabeidai121.png,jianyabeidai122.png,jianyabeidai123.png,jianyabeidai124.png,jianyabeidai125.png,jianyabeidai126.png,jianyabeidai127.png,jianyabeidai128.png,jianyabeidai129.png,jianyabeidai13.png,jianyabeidai130.png,jianyabeidai131.png,jianyabeidai132.png,jianyabeidai133.png,jianyabeidai134.png,jianyabeidai135.png,jianyabeidai136.png,jianyabeidai137.png,jianyabeidai138.png,jianyabeidai139.png,jianyabeidai14.png,jianyabeidai140.png,jianyabeidai141.png,jianyabeidai142.png,jianyabeidai143.png,jianyabeidai144.png,jianyabeidai145.png,jianyabeidai146.png,jianyabeidai147.png,jianyabeidai148.png,jianyabeidai15.png,jianyabeidai16.png,jianyabeidai17.png,jianyabeidai18.png,jianyabeidai19.png",
"name": "jianyabeidai1",
"atlas": {
"jianyabeidai133.png": {
"x": 2,
"y": 2,
"w": 348,
"h": 506,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai137.png": {
"x": 352,
"y": 2,
"w": 348,
"h": 505,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai139.png": {
"x": 2,
"y": 510,
"w": 348,
"h": 505,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai134.png": {
"x": 702,
"y": 2,
"w": 347,
"h": 504,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai135.png": {
"x": 509,
"y": 509,
"w": 347,
"h": 504,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai136.png": {
"x": 2,
"y": 860,
"w": 347,
"h": 504,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai138.png": {
"x": 508,
"y": 860,
"w": 347,
"h": 504,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai140.png": {
"x": 1051,
"y": 2,
"w": 348,
"h": 504,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai10.png": {
"x": 1015,
"y": 508,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai112.png": {
"x": 2,
"y": 1209,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai113.png": {
"x": 507,
"y": 1209,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai12.png": {
"x": 1014,
"y": 1013,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai126.png": {
"x": 1401,
"y": 2,
"w": 348,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai128.png": {
"x": 1401,
"y": 507,
"w": 348,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai129.png": {
"x": 1364,
"y": 1012,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai13.png": {
"x": 2,
"y": 1558,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai130.png": {
"x": 507,
"y": 1558,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai131.png": {
"x": 1012,
"y": 1518,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai132.png": {
"x": 1751,
"y": 2,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai141.png": {
"x": 1751,
"y": 507,
"w": 346,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai142.png": {
"x": 1713,
"y": 1012,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai143.png": {
"x": 1517,
"y": 1517,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai145.png": {
"x": 2,
"y": 1907,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai146.png": {
"x": 507,
"y": 1907,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai148.png": {
"x": 1012,
"y": 1867,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai15.png": {
"x": 1517,
"y": 1866,
"w": 347,
"h": 503,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai120.png": {
"x": 2100,
"y": 2,
"w": 346,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai123.png": {
"x": 2100,
"y": 506,
"w": 346,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai125.png": {
"x": 2099,
"y": 1010,
"w": 347,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai127.png": {
"x": 2062,
"y": 1514,
"w": 347,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai144.png": {
"x": 2,
"y": 2256,
"w": 345,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai147.png": {
"x": 506,
"y": 2256,
"w": 345,
"h": 502,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai11.png": {
"x": 1010,
"y": 2256,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai111.png": {
"x": 1513,
"y": 2216,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai115.png": {
"x": 2022,
"y": 2018,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai116.png": {
"x": 2448,
"y": 2,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai118.png": {
"x": 2411,
"y": 1514,
"w": 346,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai119.png": {
"x": 2411,
"y": 2017,
"w": 346,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai121.png": {
"x": 2,
"y": 2603,
"w": 346,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai122.png": {
"x": 505,
"y": 2603,
"w": 346,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai124.png": {
"x": 1513,
"y": 2563,
"w": 347,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai18.png": {
"x": 2448,
"y": 505,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai19.png": {
"x": 2448,
"y": 1008,
"w": 345,
"h": 501,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai110.png": {
"x": 1008,
"y": 2603,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai114.png": {
"x": 2016,
"y": 2521,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"jianyabeidai117.png": {
"x": 2795,
"y": 2,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai14.png": {
"x": 2795,
"y": 504,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai16.png": {
"x": 2795,
"y": 1006,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"jianyabeidai17.png": {
"x": 2795,
"y": 1508,
"w": 345,
"h": 500,
"ox": 21,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
}
}
},
{
"keys": "naiping10.png,naiping11.png,naiping110.png,naiping111.png,naiping112.png,naiping113.png,naiping114.png,naiping115.png,naiping116.png,naiping117.png,naiping118.png,naiping119.png,naiping12.png,naiping120.png,naiping121.png,naiping122.png,naiping123.png,naiping124.png,naiping125.png,naiping126.png,naiping127.png,naiping128.png,naiping129.png,naiping13.png,naiping130.png,naiping131.png,naiping132.png,naiping133.png,naiping134.png,naiping135.png,naiping136.png,naiping137.png,naiping138.png,naiping139.png,naiping14.png,naiping140.png,naiping141.png,naiping142.png,naiping143.png,naiping144.png,naiping145.png,naiping146.png,naiping147.png,naiping148.png,naiping15.png,naiping16.png,naiping17.png,naiping18.png,naiping19.png",
"name": "naiping1",
"atlas": {
"naiping10.png": {
"x": 2,
"y": 2,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping11.png": {
"x": 320,
"y": 2,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping110.png": {
"x": 2,
"y": 484,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping111.png": {
"x": 638,
"y": 2,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping112.png": {
"x": 2,
"y": 802,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping113.png": {
"x": 484,
"y": 484,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping114.png": {
"x": 956,
"y": 2,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping116.png": {
"x": 802,
"y": 484,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping117.png": {
"x": 2,
"y": 1120,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping118.png": {
"x": 484,
"y": 966,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping12.png": {
"x": 1274,
"y": 2,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping122.png": {
"x": 966,
"y": 966,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping123.png": {
"x": 1120,
"y": 484,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping124.png": {
"x": 2,
"y": 1438,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping126.png": {
"x": 484,
"y": 1284,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping127.png": {
"x": 966,
"y": 1284,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping129.png": {
"x": 1438,
"y": 484,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping13.png": {
"x": 1448,
"y": 966,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping134.png": {
"x": 1592,
"y": 2,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping135.png": {
"x": 2,
"y": 1756,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping138.png": {
"x": 1448,
"y": 1448,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping139.png": {
"x": 966,
"y": 1601,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping14.png": {
"x": 484,
"y": 1602,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping145.png": {
"x": 1755,
"y": 484,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping148.png": {
"x": 1909,
"y": 2,
"w": 315,
"h": 480,
"ox": 40,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping15.png": {
"x": 1766,
"y": 966,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping16.png": {
"x": 1765,
"y": 1448,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping17.png": {
"x": 966,
"y": 1918,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping18.png": {
"x": 484,
"y": 1920,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping19.png": {
"x": 2,
"y": 2073,
"w": 316,
"h": 480,
"ox": 39,
"oy": 75,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping120.png": {
"x": 1448,
"y": 1930,
"w": 314,
"h": 479,
"ox": 40,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping128.png": {
"x": 2226,
"y": 2,
"w": 313,
"h": 479,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping131.png": {
"x": 2226,
"y": 483,
"w": 313,
"h": 479,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping132.png": {
"x": 1929,
"y": 1930,
"w": 314,
"h": 479,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping140.png": {
"x": 2083,
"y": 1448,
"w": 314,
"h": 479,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping144.png": {
"x": 2084,
"y": 964,
"w": 314,
"h": 479,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping115.png": {
"x": 2,
"y": 2391,
"w": 315,
"h": 478,
"ox": 40,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping119.png": {
"x": 482,
"y": 2391,
"w": 315,
"h": 478,
"ox": 39,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping121.png": {
"x": 966,
"y": 2236,
"w": 314,
"h": 478,
"ox": 40,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping125.png": {
"x": 1446,
"y": 2246,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping130.png": {
"x": 1926,
"y": 2246,
"w": 313,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping133.png": {
"x": 2541,
"y": 2,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping136.png": {
"x": 2541,
"y": 482,
"w": 313,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping137.png": {
"x": 2541,
"y": 962,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping141.png": {
"x": 2399,
"y": 1445,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping142.png": {
"x": 2410,
"y": 1925,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": false
},
"naiping143.png": {
"x": 2,
"y": 2708,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping146.png": {
"x": 482,
"y": 2708,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
},
"naiping147.png": {
"x": 962,
"y": 2552,
"w": 314,
"h": 478,
"ox": 41,
"oy": 76,
"sw": 375,
"sh": 603,
"ro": true
}
}
},
{
"keys": "penchouwai10.png,penchouwai11.png,penchouwai110.png,penchouwai111.png,penchouwai112.png,penchouwai113.png,penchouwai114.png,penchouwai115.png,penchouwai116.png,penchouwai117.png,penchouwai118.png,penchouwai119.png,penchouwai12.png,penchouwai120.png,penchouwai121.png,penchouwai122.png,penchouwai123.png,penchouwai124.png,penchouwai125.png,penchouwai126.png,penchouwai127.png,penchouwai128.png,penchouwai129.png,penchouwai13.png,penchouwai130.png,penchouwai131.png,penchouwai132.png,penchouwai133.png,penchouwai134.png,penchouwai135.png,penchouwai136.png,penchouwai137.png,penchouwai138.png,penchouwai139.png,penchouwai14.png,penchouwai140.png,penchouwai141.png,penchouwai142.png,penchouwai143.png,penchouwai144.png,penchouwai145.png,penchouwai146.png,penchouwai147.png,penchouwai148.png,penchouwai15.png,penchouwai16.png,penchouwai17.png,penchouwai18.png,penchouwai19.png",
"name": "penchouwai1",
"atlas": {
"penchouwai132.png": {
"x": 2,
"y": 2,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai133.png": {
"x": 355,
"y": 2,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai134.png": {
"x": 2,
"y": 517,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai135.png": {
"x": 517,
"y": 517,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai136.png": {
"x": 708,
"y": 2,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai137.png": {
"x": 2,
"y": 870,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai138.png": {
"x": 517,
"y": 870,
"w": 351,
"h": 513,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai129.png": {
"x": 1061,
"y": 2,
"w": 350,
"h": 512,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai130.png": {
"x": 1032,
"y": 517,
"w": 351,
"h": 512,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai131.png": {
"x": 2,
"y": 1223,
"w": 349,
"h": 512,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai139.png": {
"x": 1032,
"y": 1031,
"w": 351,
"h": 512,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai140.png": {
"x": 1413,
"y": 2,
"w": 351,
"h": 512,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai141.png": {
"x": 516,
"y": 1223,
"w": 349,
"h": 512,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai142.png": {
"x": 1385,
"y": 516,
"w": 349,
"h": 512,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai143.png": {
"x": 1385,
"y": 1030,
"w": 350,
"h": 512,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai128.png": {
"x": 2,
"y": 1574,
"w": 350,
"h": 511,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai144.png": {
"x": 515,
"y": 1574,
"w": 350,
"h": 511,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai145.png": {
"x": 1030,
"y": 1545,
"w": 351,
"h": 511,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai127.png": {
"x": 1766,
"y": 2,
"w": 351,
"h": 510,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai146.png": {
"x": 1766,
"y": 514,
"w": 351,
"h": 510,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai110.png": {
"x": 1543,
"y": 1544,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai112.png": {
"x": 1737,
"y": 1026,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai113.png": {
"x": 2,
"y": 1926,
"w": 352,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai114.png": {
"x": 513,
"y": 1926,
"w": 352,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai115.png": {
"x": 1024,
"y": 1926,
"w": 352,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai116.png": {
"x": 1535,
"y": 1898,
"w": 353,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai117.png": {
"x": 2119,
"y": 2,
"w": 352,
"h": 509,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai118.png": {
"x": 2090,
"y": 1026,
"w": 354,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai119.png": {
"x": 2054,
"y": 1537,
"w": 354,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai120.png": {
"x": 2,
"y": 2280,
"w": 354,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai121.png": {
"x": 2119,
"y": 513,
"w": 352,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai122.png": {
"x": 513,
"y": 2280,
"w": 352,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai123.png": {
"x": 1024,
"y": 2280,
"w": 353,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai124.png": {
"x": 1535,
"y": 2253,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai125.png": {
"x": 2046,
"y": 2048,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai126.png": {
"x": 2473,
"y": 2,
"w": 349,
"h": 509,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai147.png": {
"x": 2446,
"y": 1024,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai19.png": {
"x": 2446,
"y": 1535,
"w": 351,
"h": 509,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai10.png": {
"x": 2410,
"y": 2046,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai11.png": {
"x": 2,
"y": 2636,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai111.png": {
"x": 512,
"y": 2636,
"w": 351,
"h": 508,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai12.png": {
"x": 1022,
"y": 2635,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai13.png": {
"x": 1532,
"y": 2635,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai14.png": {
"x": 2473,
"y": 513,
"w": 349,
"h": 508,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai148.png": {
"x": 2042,
"y": 2606,
"w": 349,
"h": 508,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"penchouwai15.png": {
"x": 2824,
"y": 2,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai16.png": {
"x": 2824,
"y": 512,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai17.png": {
"x": 2824,
"y": 1022,
"w": 351,
"h": 508,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"penchouwai18.png": {
"x": 2799,
"y": 1532,
"w": 349,
"h": 508,
"ox": 8,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
}
}
},
{
"keys": "yingerchuang10.png,yingerchuang11.png,yingerchuang110.png,yingerchuang111.png,yingerchuang112.png,yingerchuang113.png,yingerchuang114.png,yingerchuang115.png,yingerchuang116.png,yingerchuang117.png,yingerchuang118.png,yingerchuang119.png,yingerchuang12.png,yingerchuang120.png,yingerchuang121.png,yingerchuang122.png,yingerchuang123.png,yingerchuang124.png,yingerchuang125.png,yingerchuang126.png,yingerchuang127.png,yingerchuang128.png,yingerchuang129.png,yingerchuang13.png,yingerchuang130.png,yingerchuang131.png,yingerchuang132.png,yingerchuang133.png,yingerchuang134.png,yingerchuang135.png,yingerchuang136.png,yingerchuang137.png,yingerchuang138.png,yingerchuang139.png,yingerchuang14.png,yingerchuang140.png,yingerchuang141.png,yingerchuang142.png,yingerchuang143.png,yingerchuang144.png,yingerchuang145.png,yingerchuang146.png,yingerchuang147.png,yingerchuang148.png,yingerchuang15.png,yingerchuang16.png,yingerchuang17.png,yingerchuang18.png,yingerchuang19.png",
"name": "yingerchuang1",
"atlas": {
"yingerchuang10.png": {
"x": 2,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang11.png": {
"x": 365,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang110.png": {
"x": 2,
"y": 525,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang111.png": {
"x": 728,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang112.png": {
"x": 525,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang113.png": {
"x": 2,
"y": 889,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang114.png": {
"x": 525,
"y": 888,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang115.png": {
"x": 1091,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang116.png": {
"x": 1048,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang117.png": {
"x": 2,
"y": 1252,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang118.png": {
"x": 525,
"y": 1252,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang119.png": {
"x": 1048,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang12.png": {
"x": 1454,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang120.png": {
"x": 1411,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang121.png": {
"x": 1411,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang122.png": {
"x": 2,
"y": 1616,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang123.png": {
"x": 525,
"y": 1615,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang124.png": {
"x": 1048,
"y": 1571,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang125.png": {
"x": 1817,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang126.png": {
"x": 1774,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang127.png": {
"x": 1774,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang128.png": {
"x": 1571,
"y": 1571,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang129.png": {
"x": 2,
"y": 1979,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang13.png": {
"x": 525,
"y": 1978,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang130.png": {
"x": 1048,
"y": 1934,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang131.png": {
"x": 1571,
"y": 1934,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang132.png": {
"x": 2180,
"y": 2,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang133.png": {
"x": 2137,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang134.png": {
"x": 2137,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang135.png": {
"x": 2094,
"y": 1571,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang136.png": {
"x": 2,
"y": 2342,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang137.png": {
"x": 525,
"y": 2341,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang138.png": {
"x": 1048,
"y": 2297,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang139.png": {
"x": 1571,
"y": 2297,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang14.png": {
"x": 2094,
"y": 2094,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang140.png": {
"x": 2544,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang141.png": {
"x": 2500,
"y": 525,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang142.png": {
"x": 2500,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang143.png": {
"x": 2457,
"y": 1571,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang144.png": {
"x": 2457,
"y": 2094,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang145.png": {
"x": 2,
"y": 2705,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang146.png": {
"x": 525,
"y": 2704,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang147.png": {
"x": 1048,
"y": 2660,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang148.png": {
"x": 1571,
"y": 2660,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang15.png": {
"x": 2094,
"y": 2617,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"yingerchuang16.png": {
"x": 2907,
"y": 2,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang17.png": {
"x": 2863,
"y": 525,
"w": 362,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang18.png": {
"x": 2863,
"y": 1048,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"yingerchuang19.png": {
"x": 2820,
"y": 1571,
"w": 361,
"h": 521,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
}
}
},
{
"keys": "zhiniaoku10.png,zhiniaoku11.png,zhiniaoku110.png,zhiniaoku111.png,zhiniaoku112.png,zhiniaoku113.png,zhiniaoku114.png,zhiniaoku115.png,zhiniaoku116.png,zhiniaoku117.png,zhiniaoku118.png,zhiniaoku119.png,zhiniaoku12.png,zhiniaoku120.png,zhiniaoku121.png,zhiniaoku122.png,zhiniaoku123.png,zhiniaoku124.png,zhiniaoku125.png,zhiniaoku126.png,zhiniaoku127.png,zhiniaoku128.png,zhiniaoku129.png,zhiniaoku13.png,zhiniaoku130.png,zhiniaoku131.png,zhiniaoku132.png,zhiniaoku133.png,zhiniaoku134.png,zhiniaoku135.png,zhiniaoku136.png,zhiniaoku137.png,zhiniaoku138.png,zhiniaoku139.png,zhiniaoku14.png,zhiniaoku140.png,zhiniaoku141.png,zhiniaoku142.png,zhiniaoku143.png,zhiniaoku144.png,zhiniaoku145.png,zhiniaoku146.png,zhiniaoku147.png,zhiniaoku148.png,zhiniaoku15.png,zhiniaoku16.png,zhiniaoku17.png,zhiniaoku18.png,zhiniaoku19.png",
"name": "zhiniaoku1",
"atlas": {
"zhiniaoku12.png": {
"x": 2,
"y": 2,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku127.png": {
"x": 365,
"y": 2,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku128.png": {
"x": 2,
"y": 446,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku137.png": {
"x": 446,
"y": 446,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku142.png": {
"x": 2,
"y": 809,
"w": 362,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku16.png": {
"x": 728,
"y": 2,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku19.png": {
"x": 446,
"y": 809,
"w": 361,
"h": 442,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku119.png": {
"x": 1091,
"y": 2,
"w": 362,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku121.png": {
"x": 1091,
"y": 444,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku122.png": {
"x": 2,
"y": 1173,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku124.png": {
"x": 444,
"y": 1173,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku126.png": {
"x": 886,
"y": 1172,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku129.png": {
"x": 1455,
"y": 2,
"w": 362,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku130.png": {
"x": 1454,
"y": 444,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku131.png": {
"x": 1328,
"y": 886,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku132.png": {
"x": 2,
"y": 1536,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku133.png": {
"x": 444,
"y": 1536,
"w": 361,
"h": 440,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku10.png": {
"x": 886,
"y": 1535,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku11.png": {
"x": 1327,
"y": 1535,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku110.png": {
"x": 1819,
"y": 2,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku111.png": {
"x": 1819,
"y": 443,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku112.png": {
"x": 1817,
"y": 884,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku113.png": {
"x": 1768,
"y": 1325,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku114.png": {
"x": 2,
"y": 1899,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku115.png": {
"x": 886,
"y": 1898,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku116.png": {
"x": 443,
"y": 1899,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku117.png": {
"x": 1327,
"y": 1898,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku118.png": {
"x": 1768,
"y": 1766,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku120.png": {
"x": 2131,
"y": 1325,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku123.png": {
"x": 2180,
"y": 884,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku125.png": {
"x": 2182,
"y": 2,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku13.png": {
"x": 2182,
"y": 443,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku134.png": {
"x": 2132,
"y": 1766,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku135.png": {
"x": 2,
"y": 2262,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku136.png": {
"x": 443,
"y": 2262,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku138.png": {
"x": 884,
"y": 2262,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku139.png": {
"x": 1325,
"y": 2262,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku14.png": {
"x": 1766,
"y": 2261,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku140.png": {
"x": 2495,
"y": 1325,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku141.png": {
"x": 2544,
"y": 884,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku143.png": {
"x": 2545,
"y": 443,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku144.png": {
"x": 2546,
"y": 2,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku145.png": {
"x": 2496,
"y": 1766,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": false
},
"zhiniaoku146.png": {
"x": 2207,
"y": 2207,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku147.png": {
"x": 2,
"y": 2626,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku148.png": {
"x": 443,
"y": 2626,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku15.png": {
"x": 884,
"y": 2626,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku17.png": {
"x": 1325,
"y": 2625,
"w": 362,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
},
"zhiniaoku18.png": {
"x": 1766,
"y": 2625,
"w": 361,
"h": 439,
"ox": 7,
"oy": 15,
"sw": 375,
"sh": 603,
"ro": true
}
}
}
],
// eslint-disable-next-line
"path": "https://yun.duiba.com.cn/db_games/activity/template/1646963505/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1647326494/resource/"
}
\ No newline at end of file
......@@ -39,9 +39,9 @@ export const myApp:AppType = getApp()
export class Tools {
public static PAGE = {
isNewGuy: false,
countDownNum: 30,
musicStatus: false
resouceList: ['naiping1', 'zhiniaoku1', 'jianyabeidai1', 'penchouwai1', 'yingerchuang1'],
currIndex: 0,
offsetList: [{ x: 0,y: 0},{ x: 30,y: 0},{ x: 0,y: 0},{ x: 0,y: 0},{ x: 0,y: 0}],
};
/**
......
import { RES } from "../../module/RES";
import { Scene } from "../../module/views/Scene";
import { GDispatcher } from "../Main";
import { Tools } from "../Tools";
import UI from "../UI";
function PromiseAwait(func: Function) {
let isPromiseFulfilled = true
return async function(...args: any[]) {
if (!isPromiseFulfilled) return
isPromiseFulfilled = false
const res = await func.apply(this, args)
isPromiseFulfilled = true
return res
}
}
export class CarouselItems extends Scene {
resouceList = Tools.PAGE.resouceList
currIndex: number = 0
CarouselCont: FYGE.Container
// get currIndex() {
// return this._currIndex
// }
// set currIndex(v) {
// this._currIndex = v
// this.onShowAni(v, !(v === -1 || v === this.resouceList.length))
// }
get groupNames(): string[] {
return Tools.PAGE.resouceList
}
initUi () {
UI.Sp(this, 'sceneBack.jpg')
this.onRenderCarouselItem(Tools.PAGE.currIndex)
UI.Btn(this, 'left-arrow.png', ()=> {
this.onCarouselIndexChange(-1)
}, this, 25, 700)
UI.Btn(this, 'right-arrow.png', () => {
this.onCarouselIndexChange(1)
}, this, 650, 700)
}
onCarouselIndexChange = PromiseAwait(async (n: number) => {
const cv = this.currIndex = this.currIndex + n
await this.onShowAni(cv, cv === -1 || cv === this.resouceList.length)
})
async onShowAni(v: number, isReset: boolean = false) {
return new Promise<void>(r => {
FYGE.Tween.get(this.CarouselCont)
.to({
x: v * 750 * -1
}, 600, FYGE.Ease.quadInOut)
.call(() => {
if (isReset) {
this.currIndex = (v + this.resouceList.length) % this.resouceList.length
this.CarouselCont.x = this.currIndex * 750 * -1
}
// 同步下外部的 currIndex
GDispatcher.dispatchEvent('async-currIndex', {
currIndex: this.currIndex
})
Tools.PAGE.currIndex = this.currIndex
r()
})
})
}
onRenderCarouselItem(index: number) {
const CarouselCont = this.CarouselCont = UI.Ctn(this)
this.currIndex = index
for (let i = 0; i < this.resouceList.length; i++) {
this.onInitItem(i)
// const currResouce = this.resouceList[i];
// const testTexArr = []
// for (let i = 0; i < 50; i++) {
// testTexArr.push(RES.getRes(currResouce + (i) +".png"))
// }
// const frameAni2 = CarouselCont.addChild(new FYGE.FrameAni(testTexArr))
// frameAni2.position.set(750 * i + 375, 812)
// frameAni2.mouseEnable = frameAni2.mouseChildren = false;//鼠标事件去掉,可穿透
// frameAni2.play(0, () => {
// console.log('一次 循环')
// })//循环播放
}
// 前面放一个
this.onInitItem(this.resouceList.length-1, -1)
this.onInitItem(0, this.resouceList.length)
CarouselCont.x = index * 750 * -1
// setTimeout(() => {
// frameAni2.reset(0)
// setTimeout(() => {
// frameAni2.play(1)
// }, 2000)
// }, 1000)
}
onInitItem(i: number, posIndex?: number) {
const currResouce = this.resouceList[i];
const testTexArr = []
for (let i = 0; i < 49; i++) {
testTexArr.push(RES.getRes(currResouce + (i) +".png"))
}
const frameAni2 = this.CarouselCont.addChild(new FYGE.FrameAni(testTexArr))
const currOffset = (Tools.PAGE.offsetList && Tools.PAGE.offsetList[i]) || {x:0, y:0}
frameAni2.scale.set(1.5,1.5)
frameAni2.position.set(750 * (posIndex || i) + 375 + currOffset.x, 812 + currOffset.y)
frameAni2.mouseEnable = frameAni2.mouseChildren = false;//鼠标事件去掉,可穿透
frameAni2.play(0, () => {
console.log('一次 循环')
})//循环播放
}
}
\ No newline at end of file
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { Scene } from "../../module/views/Scene";
import { Tools } from "../Tools";
import UI from "../UI";
import Clock from '../Clock'
import { GPool } from "../../module/tools/GPool";
import { GDispatcher } from "../Main";
function randomNum(m: number, n: number) {
var max = n;
var min = m;
return Math.floor(Math.random() * (max - min)) + min;
}
const GameEvent = {
GAME_START: 'GAME_START',
GAME_OVER: 'GAME_OVER',
GAME_BGM: 'GAME_BGM',
}
class CountDownBoard extends FYGE.Container {
private _initCountDownNum: number
private _countDown: number = 3;
private _countDownText: FYGE.BitmapText;
private _countDownTimer: any;
private _countDownTimerInterval: number = 1000;
get countDown(): number {
return this._countDown
}
set countDown(v) {
this._countDown = v
this._countDownText.text = v + ''
}
constructor(num: number = 30) {
super();
this._initCountDownNum = num;
this.initUi()
}
initUi() {
UI.Sp(this, 'count-down-back.png')
this._countDownText = this.addChild(new FYGE.BitmapText(Tools.getNumTextures('')))
this._countDownText.position.set(135, 30)
this._countDownText.text = this._initCountDownNum + ''
// this._countDownText = UI.Txt(this, this._initCountDownNum + '', 30, '#fff', FYGE.TEXT_ALIGN.RIGHT, 200, 200, 30)
}
public restart() {
this.stopCountDown()
this.countDown = this._initCountDownNum
this.startCountDown()
}
public startCountDown() {
this._countDownTimer = setInterval(() => {
this.countDown--;
if (this.countDown <= 0) {
clearInterval(this._countDownTimer);
this.dispatchEvent('countdown', this.countDown)
}
}, this._countDownTimerInterval);
}
public stopCountDown() {
this._countDownTimer && clearInterval(this._countDownTimer);
}
}
interface PythicInfer {
draw: () => void,
initParent: (parent: FYGE.Container) => void
commonPythicPos: CommonPythicCollsionData
}
type PythicType = 'circle' | 'rect'
type CirclePythicCollsionData = {
x: number,
y: number,
type: PythicType,
radius: number
}
type RectPythicCollsionData = {
x: number,
y: number,
type: PythicType,
w: number,
h: number
}
type CommonPythicCollsionData = CirclePythicCollsionData | RectPythicCollsionData
// declare class PythicInfer {
// draw: () => void
// initParent: (parent: FYGE.Container) => void
// }
class PythicCont implements PythicInfer{
globalX: number
globalY: number
x: number
y: number
parent: FYGE.Container
draw() {}
initParent (parent: FYGE.Container) {
this.parent = parent
this.globalX = this.x + parent.x
this.globalY = this.y + parent.y
}
get pythicPos() {
return {
x: this.x + this.parent.x,
y: this.y + this.parent.y
}
}
get commonPythicPos(): CommonPythicCollsionData {
return
}
}
class CirclePythicCont extends PythicCont implements PythicInfer {
radius: number
type: PythicType = 'circle'
constructor(x: number, y: number, radius: number) {
super()
this.x = x
this.y = y
this.radius = radius
}
get commonPythicPos(): CommonPythicCollsionData {
return {
...this.pythicPos,
radius: this.radius,
type: this.type
}
}
draw() {
const parent = this.parent
const p = parent.addChild(new FYGE.Shape())
.beginFill('#000000')
.drawCircle(this.x, this.y, this.radius)
.endFill()
p.alpha = 0.4
}
}
class RectPythicCont extends PythicCont implements PythicInfer {
w: number
h: number
type: PythicType = 'rect'
constructor(x: number, y: number, w: number, h: number) {
super()
this.x = x
this.y = y
this.w = w
this.h = h
}
get commonPythicPos(): CommonPythicCollsionData {
return {
...this.pythicPos,
w: this.w,
h: this.h,
type: this.type
}
}
draw() {
const parent = this.parent
const p = parent.addChild(new FYGE.Shape())
.beginFill('#000000')
.drawRect(this.x, this.y, this.w, this.h)
.endFill()
p.alpha = 0.4
}
}
interface PythicContainerInfer {
pythicCont: PythicCont
addPythicCont: (cont: PythicCont, debug: boolean) => void
}
class PythicContainer extends FYGE.Container implements PythicContainerInfer {
pythicCont: PythicCont
constructor() {
super();
}
addPythicCont(cont: PythicCont, debug: boolean = false) {
this.pythicCont = cont
cont.initParent(this)
if (debug) {
cont.draw()
}
}
}
class GameEleSprit extends FYGE.Sprite implements PythicContainerInfer {
pythicCont: PythicCont
resource: string
score: number
constructor(resource: string, score?: number) {
super(RES.getRes(resource));
this.resource = resource
this.score =score
}
addPythicCont(cont: PythicCont, debug: boolean = false) {
this.pythicCont = cont
cont.initParent(this)
if (debug) {
cont.draw()
}
}
}
interface ContainsPosInfer {
x: number,
y: number,
[x: string]: any
}
/**
* 确保p1 是左上角点坐标, p2是右下角点坐标
* @param p1
* @param p2
* @param point
*/
function isInside(p1: ContainsPosInfer, p2: ContainsPosInfer, point: ContainsPosInfer) {
if (point.x > p1.x && point.x < p2.x && point.y > p1.y && point.y < p2.y) {
return true
}
return false
}
function isInsidePro(p1: ContainsPosInfer, p2: ContainsPosInfer,p3: ContainsPosInfer, p4: ContainsPosInfer, point: ContainsPosInfer) {
if (p1.y === p2.y) {
return isInside(p1, p3, point)
}
const l = Math.sqrt((p3.x - p4.x) ** 2 + (p3.y - p4.y) ** 2)
const cos = (p3.x - p4.x) / l
const sin = (p3.y = p4.y) / l
// TODO: 可以优化
return isInside({
x: p4.x,
y: p4.y + Math.sqrt((p1.x - p4.x) ** 2 + (p1.y - p4.y) ** 2)
}, {
x: p4.x + Math.sqrt((p3.x - p4.x) ** 2 + (p3.y - p4.y) ** 2),
y: p4.y
}, point)
}
function poslen(p1: ContainsPosInfer, p2: ContainsPosInfer) {
return Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2)
}
function onCollsionJudge(cont1: CommonPythicCollsionData, cont2: CommonPythicCollsionData): boolean {
if (cont1.type === 'circle' && cont2.type === 'circle') {
return Math.pow(cont1.x - cont2.x, 2) + Math.pow(cont1.y - cont2.y, 2) < Math.pow((cont1 as CirclePythicCollsionData).radius + (cont2 as CirclePythicCollsionData).radius, 2)
}
if (cont1.type === 'rect' && cont2.type === 'rect') {
const rectCont1 = cont1 as RectPythicCollsionData
const rectCont2 = cont2 as RectPythicCollsionData
return Math.abs(rectCont1.x + rectCont1.w / 2 - rectCont2.x - rectCont2.w / 2) < (rectCont1.w + rectCont2.w) / 2 && Math.abs(rectCont1.y + rectCont1.h / 2 - rectCont2.y - rectCont2.h / 2) < (rectCont1.h + rectCont2.h) / 2
}
if (cont1.type === 'circle' && cont2.type === 'rect') {
const rectCont2 = cont2 as RectPythicCollsionData
const circleCont1 = cont1 as CirclePythicCollsionData
const radius = circleCont1.radius
return isInside({
x: rectCont2.x - circleCont1.radius,
y: rectCont2.y
}, {
x: rectCont2.x + rectCont2.w + circleCont1.radius,
y: rectCont2.y + rectCont2.h
}, circleCont1) || isInside({
x: rectCont2.x,
y: rectCont2.y - circleCont1.radius
}, {
x: rectCont2.x + rectCont2.w,
y: rectCont2.y + rectCont2.h + circleCont1.radius
}, circleCont1) || poslen(rectCont2, circleCont1) < radius || poslen({
x: rectCont2.x + rectCont2.w,
y: rectCont2.y
}, circleCont1) < radius || poslen({
x: rectCont2.x,
y: rectCont2.y + rectCont2.h
}, circleCont1) < radius || poslen({
x: rectCont2.x + rectCont2.w,
y: rectCont2.y + rectCont2.h
}, circleCont1) < radius
// return Math.pow(circleCont1.x - rectCont2.x - rectCont2.w / 2, 2) + Math.pow(circleCont1.y - rectCont2.y - rectCont2.h / 2, 2) < Math.pow(circleCont1.radius + rectCont2.w / 2, 2)
}
// TODO: 其他类型的碰撞检测
if (cont1.type === 'rect' && cont2.type === 'circle') {
const circleCont2 = cont2 as CirclePythicCollsionData
const rectCont1 = cont1 as RectPythicCollsionData
return Math.pow(circleCont2.x - rectCont1.x - rectCont1.w / 2, 2) + Math.pow(circleCont2.y - rectCont1.y - rectCont1.h / 2, 2) < Math.pow(circleCont2.radius + rectCont1.w / 2, 2)
}
}
interface GameEleInfer {
resource: GameEleResource,
probability: number,
score: number
}
type GameEleResource = 'bellSprit.png' | 'orangeSprit.png' | 'boomSprit.png'
const GameEles: GameEleInfer[] = [
{
resource: 'bellSprit.png',
probability: 30,
score: 1,
},
{
resource: 'orangeSprit.png',
probability: 25,
score: 2,
},
{
resource: 'boomSprit.png',
probability: 10,
score: 0,
}
]
export default class IndexScene extends Scene {
scoreBitMapText: FYGE.BitmapText
_score: number = 0
private RobotGameEle: GameEleSprit
private spl: number = 0 // 下一个掉落元素
private speed: number = 400 // 掉落速度
clock: Clock = new Clock()
private axisX: number[] = [50, 650]
private gameElesList: GameEleSprit[] = []
private GameStatus: number = 0 // 0 未开始 1 游戏中
private CountDownCont: CountDownBoard
private musicBtn: FYGE.Button
private _musicStatus: boolean = false
get musicStatus() {
return this._musicStatus
}
set musicStatus(v) {
// if (this._musicStatus === v) return
this._musicStatus = v
this.musicBtn.texture = RES.getRes(v ? 'music-on.png' : 'music-off.png')
GDispatcher.dispatchEvent(GameEvent.GAME_BGM, v)
}
get score() {
return this._score
}
set score(s) {
this._score = s
this.scoreBitMapText.text = s + ''
}
get currGameEleResource(): GameEleInfer {
const probalibityList = GameEles.reduce((pre: number[], curr: GameEleInfer): number[] => {
pre.push(curr.probability + (pre[pre.length - 1] || 0))
return pre
}, [])
const p = randomNum(0, probalibityList[probalibityList.length - 1])
const randomEle = GameEles[probalibityList.findIndex(i => p < i)]
return randomEle
}
get groupNames(): string[] {
return ['GameScene']
}
initUi() {
UI.Sp(this, 'back.png')
this.initCountDown()
this.initScoreBoard()
this.onInitGamer()
this.initMusicBtn(Tools.PAGE.musicStatus)
// this.onInitFallGameEle()
}
async start(data?: any) {
super.start()
// 完成scene的初始化
data.gameSceneInitResolve()
}
/**
* 初始化倒计时器
*/
initCountDown() {
this.CountDownCont = this.addChild(new CountDownBoard(Tools.PAGE.countDownNum))
this.CountDownCont.position.set(0, layers.stageOffsetY + 100)
this.CountDownCont.addEventListener('countdown', this.onGameOver, this)
}
/**
* 初始化分数板
*/
initScoreBoard() {
const scoreBoardCont = UI.Ctn(this)
scoreBoardCont.position.set(layers.stageWidth - 229, layers.stageOffsetY + 100)
UI.Sp(scoreBoardCont, 'score-board-back.png')
this.scoreBitMapText = scoreBoardCont.addChild(new FYGE.BitmapText(Tools.getNumTextures('')))
this.scoreBitMapText.position.set(150, 28)
this.score = 0
}
/**
* 初始化音乐开关
* @param isOn
*/
initMusicBtn(isOn: boolean = false) {
this.musicBtn = UI.Btn(this, isOn ? 'music-on.png' : 'music-off.png', () => {
this.musicStatus = !this.musicStatus
}, this, 660, layers.stageOffsetY + 200)
}
/**
* 显示游戏前的倒计时
*/
async onShowPreCountDown() {
const preCountDownCont = UI.Ctn(this)
UI.Rect(preCountDownCont, 750, 1624, 0x000000, 0, 0, 0, 0.5)
return new Promise<void>(async (wrapResolve) => {
const num = UI.Sp(preCountDownCont, 'preCountDown3.png')
num.anchorTexture.set(0.5)
num.alpha = 0
num.position.set(375, 812)
function aniFunc() {
return new Promise(r => {
FYGE.Tween.get(num)
.to({alpha: 1}, 0.6)
FYGE.Tween.get(num)
.set({scaleX: 0, scaleY: 0})
.to({scaleX: 1.1, scaleY: 1.1}, 400)
.to({scaleX: 1, scaleY: 1}, 200)
.wait(600)
.call(r)
})
}
await aniFunc()
num.alpha = 0
num.texture = RES.getRes('preCountDown2.png')
await aniFunc()
num.alpha = 0
num.texture = RES.getRes('preCountDown1.png')
await aniFunc()
num.alpha = 0
num.texture = RES.getRes('preCountDownGo.png')
await aniFunc()
wrapResolve()
preCountDownCont.destroy()
})
}
/**
* 显示新手引导
* @returns
*/
async onShowNewGuySteps() {
return new Promise<void>(r => {
const NewGuyCont = UI.Ctn(this)
const stepSprite = UI.Sp(NewGuyCont, 'step1.png')
let step = 1
function showStepImg() {
if (step > 4) {
NewGuyCont.destroy()
r()
}
stepSprite.texture = RES.getRes(`step${step}.png`)
step ++
}
showStepImg()
NewGuyCont.addEventListener(FYGE.MouseEvent.CLICK, () => {
showStepImg()
})
})
}
/**
* 游戏初始化
*/
onGameInit() {
this.score = 0
this.musicStatus = Tools.PAGE.musicStatus
this.recoverGameEles()
this.onInitGamer()
}
/**
* 游戏开始
*/
async onGameStart() {
this.onGameInit()
if (Tools.PAGE.isNewGuy) {
await this.onShowNewGuySteps()
}
await this.onShowPreCountDown()
this.GameStatus = 1
this.CountDownCont.restart()
}
/**
* 游戏结束
*/
onGameOver() {
this.GameStatus = 0
this.CountDownCont.stopCountDown()
GDispatcher.dispatchEvent(GameEvent.GAME_OVER, {
score: this.score
})
}
/**
* 初始化游戏元素
*/
onInitGamer() {
if (!this.RobotGameEle) {
this.RobotGameEle = this.addChild(new GameEleSprit('robotGamer.png'))
this.RobotGameEle.addPythicCont(new RectPythicCont(50, 190, 100, 60), false)
}
this.RobotGameEle.position.set(375 - this.RobotGameEle.width / 2, 1100)
}
/**
* 初始化游戏掉落元素
*/
onInitFallGameEle() {
this.spl = randomNum(80, 300)
const curr = this.currGameEleResource
const currResource: GameEleResource = curr.resource
const currGameELe = GPool.takeOut<GameEleSprit>(currResource) || this.addChild(new GameEleSprit(currResource, curr.score))
currGameELe.visible = true
this.gameElesList.push(currGameELe)
currGameELe.position.set(randomNum(this.axisX[0], this.axisX[1]), layers.stageOffsetY)
if (!currGameELe.pythicCont) {
const debug = false
if (currResource === 'bellSprit.png') {
currGameELe.addPythicCont(new CirclePythicCont(36, 40, 40), debug)
} else if (currResource === 'orangeSprit.png') {
currGameELe.addPythicCont(new CirclePythicCont(50, 48, 34), debug)
} else if (currResource === 'boomSprit.png') {
currGameELe.addPythicCont(new CirclePythicCont(32, 55, 34), debug)
}
}
}
/**
* 事件
*/
initEvents(): void {
super.initEvents()
this.addEventListener(FYGE.Event.ENTER_FRAME, this.frameUpdate, this)
this.RobotGameEle.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDown, this)
GDispatcher.addEventListener(GameEvent.GAME_START, this.onGameStart, this)
}
removeEvents(): void {
super.removeEvents()
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.frameUpdate, this)
this.RobotGameEle.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDown, this)
GDispatcher.removeEventListener(GameEvent.GAME_START, this.onGameStart, this)
}
startPos: ContainsPosInfer
startRobotPos: ContainsPosInfer
onMouseDown(e: FYGE.MouseEvent) {
this.startPos = {
x: e.stageX,
y: e.stageY
}
this.startRobotPos = {
x: this.RobotGameEle.x,
y: this.RobotGameEle.y
}
this.stage.addEventListener(FYGE.MouseEvent.MOUSE_MOVE, this.onMouseMove, this)
this.stage.once(FYGE.MouseEvent.MOUSE_UP, function() {
this.stage.removeEventListener(FYGE.MouseEvent.MOUSE_MOVE, this.onMouseMove)
})
}
onMouseMove(e: FYGE.MouseEvent) {
if (!this.GameStatus) return
const currPos = {
x: e.stageX,
y: e.stageY
}
// this.startRobotPos.y + currPos.y - this.startPos.y
if (currPos.x < 100 || currPos.x > 650) return
this.RobotGameEle.position.set(this.startRobotPos.x + currPos.x - this.startPos.x, this.startRobotPos.y)
}
recoverGameEles() {
for (let i = 0; i < this.gameElesList.length; i++) {
const gameEle = this.gameElesList[i];
gameEle.visible = false
GPool.takeIn(gameEle.resource, gameEle)
}
this.gameElesList.length = 0
}
playGameEleSounds(resource: string) {
if (!this.musicStatus && resource !== 'boomSprit.png') {
return
}
const kv = {
'bellSprit.png': 'bell',
'orangeSprit.png': 'orange',
'boomSprit.png': 'boom'
}
GDispatcher.dispatchEvent(GameEvent.GAME_BGM, {
isOn: true,
key: kv[resource],
loop: false
})
}
_cacheLen:number = 0
frameUpdate() {
if (!this.GameStatus) return
const delta = this.clock.getDelta()
if (delta > 100) return
const sdt = this.speed * delta
this._cacheLen += sdt
if (this._cacheLen > this.spl) {
this._cacheLen = 0
this.onInitFallGameEle()
}
for (let i = this.gameElesList.length - 1; i >= 0; i--) {
const item = this.gameElesList[i]
item.y += sdt
if (item.y > 1624) {
item.visible = false
GPool.takeIn(item.resource, item)
this.gameElesList.splice(i, 1)
}
if (onCollsionJudge(item.pythicCont.commonPythicPos, this.RobotGameEle.pythicCont.commonPythicPos)) {
item.visible = false
GPool.takeIn(item.resource, item)
// 播放音效
this.playGameEleSounds(item.resource)
this.gameElesList.splice(i, 1)
// console.log(item)
if (item.score == 0) {
console.log('boom', item)
this.onGameOver()
}
this.score += item.score
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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