├── README.md
├── favicon.ico
├── resource
├── assets
│ ├── game
│ │ ├── bg.jpg
│ │ ├── xia.jpg
│ │ ├── shang.jpg
│ │ ├── ui
│ │ │ ├── ui.png
│ │ │ └── ui.json
│ │ ├── bg_qiang.png
│ │ ├── btn_rank.png
│ │ ├── egret_icon.png
│ │ ├── loading_bg.jpg
│ │ ├── loading_logo.png
│ │ ├── pengyouquan.png
│ │ └── role
│ │ │ ├── Sprites.png
│ │ │ ├── newAssets.png
│ │ │ ├── newAssets.json
│ │ │ └── Sprites.json
│ └── egret_icon.png
├── default.thm.json
├── config
│ └── description.json
└── default.res.json
├── .wing
├── settings.json
├── launch.json
└── tasks.json
├── bin-release
└── web
│ ├── 101101
│ ├── resource
│ │ ├── assets
│ │ │ ├── game
│ │ │ │ ├── bg.jpg
│ │ │ │ ├── shang.jpg
│ │ │ │ ├── ui
│ │ │ │ │ ├── ui.png
│ │ │ │ │ └── ui.json
│ │ │ │ ├── xia.jpg
│ │ │ │ ├── bg_qiang.png
│ │ │ │ ├── btn_rank.png
│ │ │ │ ├── egret_icon.png
│ │ │ │ ├── loading_bg.jpg
│ │ │ │ ├── loading_logo.png
│ │ │ │ ├── pengyouquan.png
│ │ │ │ └── role
│ │ │ │ │ ├── Sprites.png
│ │ │ │ │ ├── newAssets.png
│ │ │ │ │ ├── newAssets.json
│ │ │ │ │ └── Sprites.json
│ │ │ └── egret_icon.png
│ │ ├── default.thm.json
│ │ ├── config
│ │ │ └── description.json
│ │ └── default.res.json
│ ├── manifest.json
│ ├── index.html
│ └── js
│ │ ├── promise.min_83a6a5d.js
│ │ └── tween.min_6c5a88f9.js
│ └── 180824154858
│ ├── resource
│ ├── assets
│ │ ├── game
│ │ │ ├── bg.jpg
│ │ │ ├── xia.jpg
│ │ │ ├── shang.jpg
│ │ │ ├── ui
│ │ │ │ ├── ui.png
│ │ │ │ └── ui.json
│ │ │ ├── bg_qiang.png
│ │ │ ├── btn_rank.png
│ │ │ ├── egret_icon.png
│ │ │ ├── loading_bg.jpg
│ │ │ ├── pengyouquan.png
│ │ │ ├── loading_logo.png
│ │ │ └── role
│ │ │ │ ├── Sprites.png
│ │ │ │ ├── newAssets.png
│ │ │ │ ├── newAssets.json
│ │ │ │ └── Sprites.json
│ │ └── egret_icon.png
│ ├── default.thm.json
│ ├── config
│ │ └── description.json
│ └── default.res.json
│ ├── manifest.json
│ ├── index.html
│ └── js
│ ├── promise.min_83a6a5d.js
│ └── tween.min_6c5a88f9.js
├── wingProperties.json
├── template
├── runtime
│ ├── native_loader.js
│ ├── runtime_loader.js
│ └── native_require.js
└── web
│ └── index.html
├── tsconfig.json
├── scripts
├── myplugin.ts
├── config.bricks.ts
├── config.ios.ts
├── config.android.ts
├── bricks
│ └── bricks.ts
├── config.wxgame.ts
├── config.ts
├── wxgame
│ └── wxgame.ts
├── tsconfig.json
└── api.d.ts
├── egretProperties.json
├── manifest.json
├── src
├── Platform.ts
├── game
│ ├── comment
│ │ ├── Shake.ts
│ │ ├── MyButton.ts
│ │ ├── SpecialNumber.ts
│ │ └── Role.ts
│ ├── GameApp.ts
│ ├── GameConst.ts
│ ├── layer
│ │ ├── StartGameLayer.ts
│ │ └── GameOverLayer.ts
│ └── GameControl.ts
├── LoadingUI.ts
├── AssetAdapter.ts
├── ThemeAdapter.ts
└── Main.ts
├── libs
├── exml.e.d.ts
└── modules
│ ├── promise
│ └── promise.min.js
│ └── tween
│ └── tween.min.js
├── bin-debug
├── game
│ ├── GameConst.js
│ ├── comment
│ │ ├── Shake.js
│ │ ├── SpecialNumber.js
│ │ ├── MyButton.js
│ │ └── Role.js
│ ├── GameApp.js
│ ├── layer
│ │ ├── StartGameLayer.js
│ │ └── GameOverLayer.js
│ └── GameControl.js
├── AssetAdapter.js
├── LoadingUI.js
├── ThemeAdapter.js
├── Platform.js
└── Main.js
└── index.html
/README.md:
--------------------------------------------------------------------------------
1 | # RoomRun
2 | Egret密室逃生小游戏
3 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/favicon.ico
--------------------------------------------------------------------------------
/resource/assets/game/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/bg.jpg
--------------------------------------------------------------------------------
/resource/assets/game/xia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/xia.jpg
--------------------------------------------------------------------------------
/resource/assets/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/egret_icon.png
--------------------------------------------------------------------------------
/resource/assets/game/shang.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/shang.jpg
--------------------------------------------------------------------------------
/resource/assets/game/ui/ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/ui/ui.png
--------------------------------------------------------------------------------
/resource/assets/game/bg_qiang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/bg_qiang.png
--------------------------------------------------------------------------------
/resource/assets/game/btn_rank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/btn_rank.png
--------------------------------------------------------------------------------
/resource/assets/game/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/egret_icon.png
--------------------------------------------------------------------------------
/resource/assets/game/loading_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/loading_bg.jpg
--------------------------------------------------------------------------------
/resource/assets/game/loading_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/loading_logo.png
--------------------------------------------------------------------------------
/resource/assets/game/pengyouquan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/pengyouquan.png
--------------------------------------------------------------------------------
/resource/assets/game/role/Sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/role/Sprites.png
--------------------------------------------------------------------------------
/resource/assets/game/role/newAssets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/resource/assets/game/role/newAssets.png
--------------------------------------------------------------------------------
/.wing/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "search.exclude": {
3 | "**/bin-debug": true,
4 | "**/bin-release": true
5 | }
6 | ,
7 | "git.enabled": false
8 | }
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/bg.jpg
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/egret_icon.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/shang.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/shang.jpg
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/ui/ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/ui/ui.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/xia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/xia.jpg
--------------------------------------------------------------------------------
/resource/default.thm.json:
--------------------------------------------------------------------------------
1 | {
2 | "skins": {
3 | },
4 | "autoGenerateExmlsList": true,
5 | "exmls": [
6 | ],
7 | "path": "resource/default.thm.json"
8 | }
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/bg_qiang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/bg_qiang.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/btn_rank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/btn_rank.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/egret_icon.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/loading_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/loading_bg.jpg
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/bg.jpg
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/xia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/xia.jpg
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/loading_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/loading_logo.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/pengyouquan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/pengyouquan.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/role/Sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/role/Sprites.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/egret_icon.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/shang.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/shang.jpg
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/ui/ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/ui/ui.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/role/newAssets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/101101/resource/assets/game/role/newAssets.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/bg_qiang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/bg_qiang.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/btn_rank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/btn_rank.png
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/default.thm.json:
--------------------------------------------------------------------------------
1 | {
2 | "skins": {
3 | },
4 | "autoGenerateExmlsList": true,
5 | "exmls": [
6 | ],
7 | "path": "resource/default.thm.json"
8 | }
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/egret_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/egret_icon.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/loading_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/loading_bg.jpg
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/pengyouquan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/pengyouquan.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/loading_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/loading_logo.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/role/Sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/role/Sprites.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/role/newAssets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shenysun/RoomRun/HEAD/bin-release/web/180824154858/resource/assets/game/role/newAssets.png
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/default.thm.json:
--------------------------------------------------------------------------------
1 | {
2 | "skins": {
3 | },
4 | "autoGenerateExmlsList": true,
5 | "exmls": [
6 | ],
7 | "path": "resource/default.thm.json"
8 | }
--------------------------------------------------------------------------------
/wingProperties.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourcePlugin":{
3 | "configs":[{
4 | "configPath":"resource/default.res.json",
5 | "relativePath":"resource/"
6 | }]
7 | },
8 | "theme":"resource/default.thm.json"
9 | }
--------------------------------------------------------------------------------
/template/runtime/native_loader.js:
--------------------------------------------------------------------------------
1 | require("launcher/native_require.js");
2 |
3 | egret_native.egtMain = function () {
4 | egret_native.nativeType = "native";
5 |
6 | egret_native.egretInit();
7 | egret_native.egretStart();
8 | };
9 |
--------------------------------------------------------------------------------
/template/runtime/runtime_loader.js:
--------------------------------------------------------------------------------
1 | require("launcher/native_require.js");
2 |
3 | egret_native.egtMain = function () {
4 | egret_native.nativeType = "runtime";
5 |
6 | egret_native.egretInit();
7 | egret_native.egretStart();
8 | };
--------------------------------------------------------------------------------
/resource/config/description.json:
--------------------------------------------------------------------------------
1 | [
2 | "Open-source,Free,Multi-platform",
3 | "Push Game Forward",
4 | "HTML5 Game Engine"
5 | ]
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/config/description.json:
--------------------------------------------------------------------------------
1 | [
2 | "Open-source,Free,Multi-platform",
3 | "Push Game Forward",
4 | "HTML5 Game Engine"
5 | ]
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/config/description.json:
--------------------------------------------------------------------------------
1 | [
2 | "Open-source,Free,Multi-platform",
3 | "Push Game Forward",
4 | "HTML5 Game Engine"
5 | ]
--------------------------------------------------------------------------------
/bin-release/web/101101/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "initial": [
3 | "js/egret.min_de42afe8.js",
4 | "js/egret.web.min_22d454fa.js",
5 | "js/eui.min_22447123.js",
6 | "js/assetsmanager.min_ac6b67d6.js",
7 | "js/tween.min_6c5a88f9.js",
8 | "js/promise.min_83a6a5d.js"
9 | ],
10 | "game": [
11 | "js/main.min_40028269.js"
12 | ]
13 | }
--------------------------------------------------------------------------------
/bin-release/web/180824154858/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "initial": [
3 | "js/egret.min_de42afe8.js",
4 | "js/egret.web.min_22d454fa.js",
5 | "js/eui.min_22447123.js",
6 | "js/assetsmanager.min_ac6b67d6.js",
7 | "js/tween.min_6c5a88f9.js",
8 | "js/promise.min_83a6a5d.js"
9 | ],
10 | "game": [
11 | "js/main.min_40028269.js"
12 | ]
13 | }
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "outDir": "bin-debug",
5 | "experimentalDecorators": true,
6 | "lib": [
7 | "es5",
8 | "dom",
9 | "es2015.promise"
10 | ],
11 | "types": []
12 | },
13 | "include": [
14 | "src",
15 | "libs"
16 | ]
17 | }
--------------------------------------------------------------------------------
/scripts/myplugin.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 示例自定义插件,您可以查阅 http://developer.egret.com/cn/2d/projectConfig/cmdExtensionPluginin/
3 | * 了解如何开发一个自定义插件
4 | */
5 | export class CustomPlugin implements plugins.Command {
6 |
7 | constructor() {
8 | }
9 |
10 | async onFile(file: plugins.File) {
11 | return file;
12 | }
13 |
14 | async onFinish(commandContext: plugins.CommandContext) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/egretProperties.json:
--------------------------------------------------------------------------------
1 | {
2 | "engineVersion": "5.2.6",
3 | "compilerVersion": "5.2.6",
4 | "template": {},
5 | "target": {
6 | "current": "web"
7 | },
8 | "eui": {
9 | "exmlRoot": [
10 | "resource/eui_skins"
11 | ],
12 | "themes": [
13 | "resource/default.thm.json"
14 | ],
15 | "exmlPublishPolicy": "commonjs"
16 | },
17 | "modules": [
18 | {
19 | "name": "egret"
20 | },
21 | {
22 | "name": "eui"
23 | },
24 | {
25 | "name": "assetsmanager"
26 | },
27 | {
28 | "name": "tween"
29 | },
30 | {
31 | "name": "promise"
32 | }
33 | ]
34 | }
--------------------------------------------------------------------------------
/.wing/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Launch Wing Player",
6 | "type": "chrome",
7 | "request": "launch",
8 | "file": "index.html",
9 | "runtimeExecutable": "${execPath}",
10 | "useBuildInServer": true,
11 | "sourceMaps": true,
12 | "webRoot": "${workspaceRoot}",
13 | "preLaunchTask":"build",
14 | "port":5768
15 | },
16 | {
17 | "name": "Launch Chrome",
18 | "type": "chrome",
19 | "request": "launch",
20 | "file": "index.html",
21 | "useBuildInServer": true,
22 | "sourceMaps": true,
23 | "webRoot": "${workspaceRoot}",
24 | "preLaunchTask":"build",
25 | "userDataDir":"${tmpdir}",
26 | "port":5768
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "initial": [
3 | "libs/modules/egret/egret.js",
4 | "libs/modules/egret/egret.web.js",
5 | "libs/modules/eui/eui.js",
6 | "libs/modules/assetsmanager/assetsmanager.js",
7 | "libs/modules/tween/tween.js",
8 | "libs/modules/promise/promise.js"
9 | ],
10 | "game": [
11 | "bin-debug/game/GameControl.js",
12 | "bin-debug/AssetAdapter.js",
13 | "bin-debug/Main.js",
14 | "bin-debug/Platform.js",
15 | "bin-debug/ThemeAdapter.js",
16 | "bin-debug/game/GameApp.js",
17 | "bin-debug/game/GameConst.js",
18 | "bin-debug/LoadingUI.js",
19 | "bin-debug/game/comment/MyButton.js",
20 | "bin-debug/game/comment/Role.js",
21 | "bin-debug/game/comment/Shake.js",
22 | "bin-debug/game/comment/SpecialNumber.js",
23 | "bin-debug/game/layer/GameOverLayer.js",
24 | "bin-debug/game/layer/GameScenesLayer.js",
25 | "bin-debug/game/layer/StartGameLayer.js"
26 | ]
27 | }
--------------------------------------------------------------------------------
/.wing/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.1.0",
3 | "command": "egret",
4 | "isShellCommand": true,
5 | "suppressTaskName": true,
6 | "tasks": [
7 | {
8 | "taskName": "build",
9 | "showOutput": "always",
10 | "args": [
11 | "build",
12 | "-sourcemap"
13 | ],
14 | "problemMatcher": "$tsc"
15 | },
16 | {
17 | "taskName": "clean",
18 | "showOutput": "always",
19 | "args": [
20 | "build",
21 | "-e"
22 | ],
23 | "problemMatcher": "$tsc"
24 | },
25 | {
26 | "taskName": "publish",
27 | "showOutput": "always",
28 | "args": [
29 | "publish"
30 | ],
31 | "problemMatcher": "$tsc"
32 | }
33 | ]
34 | }
--------------------------------------------------------------------------------
/src/Platform.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 平台数据接口。
3 | * 由于每款游戏通常需要发布到多个平台上,所以提取出一个统一的接口用于开发者获取平台数据信息
4 | * 推荐开发者通过这种方式封装平台逻辑,以保证整体结构的稳定
5 | * 由于不同平台的接口形式各有不同,白鹭推荐开发者将所有接口封装为基于 Promise 的异步形式
6 | */
7 | declare interface Platform {
8 |
9 | getUserInfo(): Promise;
10 |
11 | login(): Promise
12 |
13 | ShowshareMenu(): Promise
14 |
15 | ShareMessage(): Promise
16 |
17 | GetInfo():Promise
18 | }
19 |
20 | class DebugPlatform implements Platform {
21 | async getUserInfo() {
22 | return { nickName: "username" }
23 | }
24 | async login() {
25 |
26 | }
27 | async ShowshareMenu() {
28 |
29 | }
30 | async ShareMessage() {
31 |
32 | }
33 | async GetInfo(){
34 |
35 | }
36 | }
37 |
38 |
39 | if (!window.platform) {
40 | window.platform = new DebugPlatform();
41 | }
42 |
43 |
44 |
45 | declare let platform: Platform;
46 |
47 | declare interface Window {
48 |
49 | platform: Platform
50 | }
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/resource/assets/game/role/newAssets.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "newAssets.png"
3 | ,
4 | "frames": {
5 | "1ci": {"x":226, "y":183, "w":43, "h":21, "offX":2,"offY":2,"sourceW":45,"sourceH":25},
6 | "1ci_light": {"x":127, "y":183, "w":98, "h":91, "offX":0,"offY":0,"sourceW":98,"sourceH":91},
7 | "2ci": {"x":0, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
8 | "2ci_light": {"x":0, "y":132, "w":126, "h":110, "offX":0,"offY":0,"sourceW":126,"sourceH":110},
9 | "3ci": {"x":46, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
10 | "3ci_light": {"x":0, "y":0, "w":152, "h":131, "offX":0,"offY":0,"sourceW":152,"sourceH":131},
11 | "framebg": {"x":153, "y":0, "w":127, "h":182, "offX":1,"offY":1,"sourceW":129,"sourceH":184},
12 | "fuhuo": {"x":87, "y":275, "w":86, "h":34, "offX":2,"offY":2,"sourceW":88,"sourceH":38},
13 | "jieshu": {"x":174, "y":275, "w":77, "h":33, "offX":0,"offY":2,"sourceW":77,"sourceH":37},
14 | "wudi": {"x":0, "y":275, "w":86, "h":33, "offX":2,"offY":2,"sourceW":88,"sourceH":37}
15 |
16 | }}
--------------------------------------------------------------------------------
/src/game/comment/Shake.ts:
--------------------------------------------------------------------------------
1 | /**墙体晃动 */
2 | class Shake {
3 | private initY:number;
4 | private shakeNum:number;
5 | private overFunc:Function;
6 | private obj:egret.DisplayObject;
7 | private num:number;
8 | private flag:number;
9 |
10 | public run (obj:egret.DisplayObject, shakeNum:number, overFunc:Function = null) {
11 | this.obj = obj;
12 | this.initY = obj.y;
13 | this.shakeNum = shakeNum;
14 | this.overFunc = overFunc;
15 | egret.startTick(this.loop, this);
16 | this.num = 0;
17 | this.flag = 0;
18 | }
19 | private loop():boolean {
20 | if(this.flag == 0) {
21 | if(this.obj.y <= this.initY) {
22 | this.obj.y += 5;
23 | } else {
24 | this.obj.y -= 5;
25 | }
26 | if(this.obj.y == this.initY) {
27 | this.num ++;
28 | if(this.num == this.shakeNum) {
29 | egret.stopTick(this.loop, this);
30 | if(this.overFunc) {
31 | this.overFunc();
32 | }
33 | }
34 | }
35 | }
36 | this.flag++;
37 | if(this.flag == 2) {
38 | this.flag = 0;
39 | }
40 | return false;
41 | }
42 | }
--------------------------------------------------------------------------------
/src/game/GameApp.ts:
--------------------------------------------------------------------------------
1 | class GameApp extends egret.DisplayObjectContainer {
2 | public constructor() {
3 | super();
4 | this.addEventListener(egret.Event.ADDED_TO_STAGE, this.addStage, this);
5 | }
6 |
7 | public static xia:egret.DisplayObject = new egret.DisplayObject();
8 | private addStage() {
9 | var title = "密室逃生";
10 | var content = "尼玛,活着真是不容易";
11 | var link = "http://static.egret-labs.org/h5game/8/release.html";
12 | var ico = "http://static.egret-labs.org/h5game/icons/10000008.jpg";
13 |
14 |
15 | var shang:egret.Bitmap = GameConst.CreateBitmapByName("shang_jpg");
16 | shang.height = this.y;
17 | this.stage.addChild(shang);
18 |
19 | var xia:egret.Bitmap = GameConst.CreateBitmapByName("xia_jpg");
20 | xia.y = this.y + GameConst.StageH;
21 | xia.height = this.y;
22 | this.stage.addChild(xia);
23 | GameApp.xia = xia;
24 |
25 | GameControl.Instance.setStageHandler(this);
26 | //游戏开始
27 | GameControl.Instance.startGameHandler();
28 | }
29 | }
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/role/newAssets.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "newAssets.png"
3 | ,
4 | "frames": {
5 | "1ci": {"x":226, "y":183, "w":43, "h":21, "offX":2,"offY":2,"sourceW":45,"sourceH":25},
6 | "1ci_light": {"x":127, "y":183, "w":98, "h":91, "offX":0,"offY":0,"sourceW":98,"sourceH":91},
7 | "2ci": {"x":0, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
8 | "2ci_light": {"x":0, "y":132, "w":126, "h":110, "offX":0,"offY":0,"sourceW":126,"sourceH":110},
9 | "3ci": {"x":46, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
10 | "3ci_light": {"x":0, "y":0, "w":152, "h":131, "offX":0,"offY":0,"sourceW":152,"sourceH":131},
11 | "framebg": {"x":153, "y":0, "w":127, "h":182, "offX":1,"offY":1,"sourceW":129,"sourceH":184},
12 | "fuhuo": {"x":87, "y":275, "w":86, "h":34, "offX":2,"offY":2,"sourceW":88,"sourceH":38},
13 | "jieshu": {"x":174, "y":275, "w":77, "h":33, "offX":0,"offY":2,"sourceW":77,"sourceH":37},
14 | "wudi": {"x":0, "y":275, "w":86, "h":33, "offX":2,"offY":2,"sourceW":88,"sourceH":37}
15 |
16 | }}
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/role/newAssets.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "newAssets.png"
3 | ,
4 | "frames": {
5 | "1ci": {"x":226, "y":183, "w":43, "h":21, "offX":2,"offY":2,"sourceW":45,"sourceH":25},
6 | "1ci_light": {"x":127, "y":183, "w":98, "h":91, "offX":0,"offY":0,"sourceW":98,"sourceH":91},
7 | "2ci": {"x":0, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
8 | "2ci_light": {"x":0, "y":132, "w":126, "h":110, "offX":0,"offY":0,"sourceW":126,"sourceH":110},
9 | "3ci": {"x":46, "y":243, "w":45, "h":21, "offX":0,"offY":2,"sourceW":45,"sourceH":25},
10 | "3ci_light": {"x":0, "y":0, "w":152, "h":131, "offX":0,"offY":0,"sourceW":152,"sourceH":131},
11 | "framebg": {"x":153, "y":0, "w":127, "h":182, "offX":1,"offY":1,"sourceW":129,"sourceH":184},
12 | "fuhuo": {"x":87, "y":275, "w":86, "h":34, "offX":2,"offY":2,"sourceW":88,"sourceH":38},
13 | "jieshu": {"x":174, "y":275, "w":77, "h":33, "offX":0,"offY":2,"sourceW":77,"sourceH":37},
14 | "wudi": {"x":0, "y":275, "w":86, "h":33, "offX":2,"offY":2,"sourceW":88,"sourceH":37}
15 |
16 | }}
--------------------------------------------------------------------------------
/libs/exml.e.d.ts:
--------------------------------------------------------------------------------
1 | declare module skins{
2 | class ButtonSkin extends eui.Skin{
3 | }
4 | }
5 | declare module skins{
6 | class CheckBoxSkin extends eui.Skin{
7 | }
8 | }
9 | declare module skins{
10 | class HScrollBarSkin extends eui.Skin{
11 | }
12 | }
13 | declare module skins{
14 | class HSliderSkin extends eui.Skin{
15 | }
16 | }
17 | declare module skins{
18 | class ItemRendererSkin extends eui.Skin{
19 | }
20 | }
21 | declare module skins{
22 | class PanelSkin extends eui.Skin{
23 | }
24 | }
25 | declare module skins{
26 | class ProgressBarSkin extends eui.Skin{
27 | }
28 | }
29 | declare module skins{
30 | class RadioButtonSkin extends eui.Skin{
31 | }
32 | }
33 | declare module skins{
34 | class ScrollerSkin extends eui.Skin{
35 | }
36 | }
37 | declare module skins{
38 | class TextInputSkin extends eui.Skin{
39 | }
40 | }
41 | declare module skins{
42 | class ToggleSwitchSkin extends eui.Skin{
43 | }
44 | }
45 | declare module skins{
46 | class VScrollBarSkin extends eui.Skin{
47 | }
48 | }
49 | declare module skins{
50 | class VSliderSkin extends eui.Skin{
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/game/comment/MyButton.ts:
--------------------------------------------------------------------------------
1 | /**自定义按钮类 */
2 | class MyButton extends egret.Sprite {
3 | private _bg:egret.Bitmap;
4 | private title:egret.Bitmap;
5 | private onClick:Function;
6 |
7 | public constructor(bgName:string, titleName:string) {
8 | super();
9 | this._bg = GameConst.createBitmapFromSheet(bgName, "ui");
10 | this.addChild(this._bg);
11 |
12 | this.title = GameConst.createBitmapFromSheet(titleName, "ui");
13 |
14 | this.title.x = (this._bg.width - this.title.width) >> 1;
15 | this.title.y = (this._bg.height - this.title.height) >> 1;
16 | this.addChild(this.title);
17 | }
18 |
19 | //设置点击触发事件
20 | public setClick(func:Function):void {
21 | this.touchEnabled = true;
22 | this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClickEvent, this);
23 | this.onClick = func;
24 | }
25 | //点击触发的事件
26 | private onClickEvent() {
27 | this.onClick();
28 | }
29 |
30 | public setTitle(title:string):void {
31 | this.title = GameConst.CreateBitmapByName(title);
32 | }
33 |
34 | public get bg() {
35 | return this._bg;
36 | }
37 | public set bg(bg:egret.Bitmap) {
38 | this._bg = bg;
39 | }
40 | }
--------------------------------------------------------------------------------
/scripts/config.bricks.ts:
--------------------------------------------------------------------------------
1 | /// 阅读 api.d.ts 查看文档
2 | ///
3 |
4 | import * as path from 'path';
5 | import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin } from 'built-in';
6 | import { BricksPlugin } from './bricks/bricks';
7 | import { CustomPlugin } from './myplugin';
8 | import * as defaultConfig from './config';
9 |
10 | const config: ResourceManagerConfig = {
11 |
12 | buildConfig: (params) => {
13 |
14 | const { target, command, projectName, version } = params;
15 | const outputDir = `../${projectName}_bricks/PublicBrickEngineGame/Res`;
16 | return {
17 | outputDir,
18 | commands: [
19 | new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
20 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
21 | new ManifestPlugin({ output: 'manifest.json' }),
22 | new BricksPlugin()
23 | ]
24 | }
25 | },
26 |
27 | mergeSelector: defaultConfig.mergeSelector,
28 |
29 | typeSelector: defaultConfig.typeSelector
30 | }
31 |
32 |
33 |
34 | export = config;
35 |
--------------------------------------------------------------------------------
/src/game/comment/SpecialNumber.ts:
--------------------------------------------------------------------------------
1 | /**特殊字符数字类 */
2 | class SpecialNumber extends egret.DisplayObjectContainer {
3 | public constructor() {
4 | super();
5 | }
6 | public gap:number = 0;
7 | /**设置显示的字符串 */
8 | public setData(str:string):void {
9 | this.clear();
10 | if(str == "" || str == null) {
11 | return;
12 | }
13 | //把所有数字每一个都存进数组中
14 | let chars:Array = str.split("");
15 | let w:number = 0;
16 | //所有的长度
17 | let length:number = chars.length;
18 | for(let i:number = 0; i < length; i++) {
19 | try {
20 | let image:egret.Bitmap = GameConst.createBitmapFromSheet(chars[i], "ui");
21 | if(image) {
22 | image.x = w;
23 | w += image.width + this.gap;
24 | this.addChild(image);
25 | }
26 | } catch (error) {
27 | console.log(error);
28 | }
29 | }
30 | this.anchorOffsetX = this.width / 2;
31 | }
32 | public clear() {
33 | while(this.numChildren) {
34 | this.removeChildAt(0);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/src/game/GameConst.ts:
--------------------------------------------------------------------------------
1 | /**常用常量类 */
2 | class GameConst {
3 | /**舞台宽度 */
4 | public static StageW:number;
5 | /**舞台高度 */
6 | public static StageH:number;
7 |
8 | /**根据名字创建位图 */
9 | public static CreateBitmapByName(name:string):egret.Bitmap {
10 | let texture:egret.Texture = RES.getRes(name);
11 | let bitmap:egret.Bitmap = new egret.Bitmap(texture);
12 | return bitmap;
13 | }
14 | /**
15 | * 根据name关键字创建一个Bitmap对象。此name 是根据TexturePacker 组合成的一张位图
16 | */
17 | public static createBitmapFromSheet(name:string, sheetName:string):egret.Bitmap {
18 | let texture:egret.Texture = RES.getRes(`${sheetName}_json.${name}`);
19 | let result:egret.Bitmap = new egret.Bitmap(texture);
20 | return result;
21 | }
22 |
23 | public static getTextureFromSheet(name:string, sheetName:string):egret.Texture {
24 | let result:egret.Texture = RES.getRes(`${sheetName}_json.${name}`);
25 | return result;
26 | }
27 | /**移除子类方法 */
28 | public static removeChild(child:egret.DisplayObject) {
29 | if(child && child.parent) {
30 | if((child.parent).removeElement) {
31 | (child.parent).removeElement((child));
32 | }
33 | else {
34 | child.parent.removeChild(child);
35 | }
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/scripts/config.ios.ts:
--------------------------------------------------------------------------------
1 | /// 阅读 api.d.ts 查看文档
2 | ///
3 |
4 | import * as path from 'path';
5 | import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin } from 'built-in';
6 | import { BricksPlugin } from './bricks/bricks';
7 | import { CustomPlugin } from './myplugin';
8 | import * as defaultConfig from './config';
9 |
10 | const config: ResourceManagerConfig = {
11 |
12 | buildConfig: (params) => {
13 |
14 | const { target, command, projectName, version } = params;
15 | const outputDir = `../${projectName}_ios/assets/game`;
16 | return {
17 | outputDir,
18 | commands: [
19 | new CompilePlugin({ libraryType: "debug", defines: { DEBUG: false, RELEASE: true } }),
20 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
21 | new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
22 | new UglifyPlugin([{
23 | sources: ["main.js"],
24 | target: "main.min.js"
25 | }]),
26 | new ManifestPlugin({ output: 'manifest.json' })
27 | ]
28 | }
29 | },
30 |
31 | mergeSelector: defaultConfig.mergeSelector,
32 |
33 | typeSelector: defaultConfig.typeSelector
34 | }
35 |
36 |
37 |
38 | export = config;
39 |
--------------------------------------------------------------------------------
/scripts/config.android.ts:
--------------------------------------------------------------------------------
1 | /// 阅读 api.d.ts 查看文档
2 | ///
3 |
4 | import * as path from 'path';
5 | import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin } from 'built-in';
6 | import { BricksPlugin } from './bricks/bricks';
7 | import { CustomPlugin } from './myplugin';
8 | import * as defaultConfig from './config';
9 |
10 | const config: ResourceManagerConfig = {
11 |
12 | buildConfig: (params) => {
13 |
14 | const { target, command, projectName, version } = params;
15 | const outputDir = `../${projectName}_android/assets/game`;
16 | return {
17 | outputDir,
18 | commands: [
19 | // new CompilePlugin({ libraryType: "debug", defines: { DEBUG: false, RELEASE: true } }),
20 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
21 | new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
22 | new UglifyPlugin([{
23 | sources: ["main.js"],
24 | target: "main.min.js"
25 | }]),
26 | new ManifestPlugin({ output: 'manifest.json' })
27 | ]
28 | }
29 | },
30 |
31 | mergeSelector: defaultConfig.mergeSelector,
32 |
33 | typeSelector: defaultConfig.typeSelector
34 | }
35 |
36 |
37 |
38 | export = config;
39 |
--------------------------------------------------------------------------------
/bin-debug/game/GameConst.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | /**常用常量类 */
5 | var GameConst = (function () {
6 | function GameConst() {
7 | }
8 | /**根据名字创建位图 */
9 | GameConst.CreateBitmapByName = function (name) {
10 | var texture = RES.getRes(name);
11 | var bitmap = new egret.Bitmap(texture);
12 | return bitmap;
13 | };
14 | /**
15 | * 根据name关键字创建一个Bitmap对象。此name 是根据TexturePacker 组合成的一张位图
16 | */
17 | GameConst.createBitmapFromSheet = function (name, sheetName) {
18 | var texture = RES.getRes(sheetName + "_json." + name);
19 | var result = new egret.Bitmap(texture);
20 | return result;
21 | };
22 | GameConst.getTextureFromSheet = function (name, sheetName) {
23 | var result = RES.getRes(sheetName + "_json." + name);
24 | return result;
25 | };
26 | /**移除子类方法 */
27 | GameConst.removeChild = function (child) {
28 | if (child && child.parent) {
29 | if (child.parent.removeElement) {
30 | child.parent.removeElement((child));
31 | }
32 | else {
33 | child.parent.removeChild(child);
34 | }
35 | }
36 | };
37 | return GameConst;
38 | }());
39 | __reflect(GameConst.prototype, "GameConst");
40 |
--------------------------------------------------------------------------------
/bin-debug/game/comment/Shake.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | /**墙体晃动 */
5 | var Shake = (function () {
6 | function Shake() {
7 | }
8 | Shake.prototype.run = function (obj, shakeNum, overFunc) {
9 | if (overFunc === void 0) { overFunc = null; }
10 | this.obj = obj;
11 | this.initY = obj.y;
12 | this.shakeNum = shakeNum;
13 | this.overFunc = overFunc;
14 | egret.startTick(this.loop, this);
15 | this.num = 0;
16 | this.flag = 0;
17 | };
18 | Shake.prototype.loop = function () {
19 | if (this.flag == 0) {
20 | if (this.obj.y <= this.initY) {
21 | this.obj.y += 5;
22 | }
23 | else {
24 | this.obj.y -= 5;
25 | }
26 | if (this.obj.y == this.initY) {
27 | this.num++;
28 | if (this.num == this.shakeNum) {
29 | egret.stopTick(this.loop, this);
30 | if (this.overFunc) {
31 | this.overFunc();
32 | }
33 | }
34 | }
35 | }
36 | this.flag++;
37 | if (this.flag == 2) {
38 | this.flag = 0;
39 | }
40 | return false;
41 | };
42 | return Shake;
43 | }());
44 | __reflect(Shake.prototype, "Shake");
45 |
--------------------------------------------------------------------------------
/bin-debug/game/GameApp.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | var GameApp = (function (_super) {
12 | __extends(GameApp, _super);
13 | function GameApp() {
14 | var _this = _super.call(this) || this;
15 | _this.addEventListener(egret.Event.ADDED_TO_STAGE, _this.addStage, _this);
16 | return _this;
17 | }
18 | GameApp.prototype.addStage = function () {
19 | var title = "密室逃生";
20 | var content = "尼玛,活着真是不容易";
21 | var link = "http://static.egret-labs.org/h5game/8/release.html";
22 | var ico = "http://static.egret-labs.org/h5game/icons/10000008.jpg";
23 | var shang = GameConst.CreateBitmapByName("shang_jpg");
24 | shang.height = this.y;
25 | this.stage.addChild(shang);
26 | var xia = GameConst.CreateBitmapByName("xia_jpg");
27 | xia.y = this.y + GameConst.StageH;
28 | xia.height = this.y;
29 | this.stage.addChild(xia);
30 | GameApp.xia = xia;
31 | GameControl.Instance.setStageHandler(this);
32 | //游戏开始
33 | GameControl.Instance.startGameHandler();
34 | };
35 | GameApp.xia = new egret.DisplayObject();
36 | return GameApp;
37 | }(egret.DisplayObjectContainer));
38 | __reflect(GameApp.prototype, "GameApp");
39 |
--------------------------------------------------------------------------------
/template/runtime/native_require.js:
--------------------------------------------------------------------------------
1 | var manifest = JSON.parse(egret_native.readFileSync("manifest.json"));
2 | var game_file_list = manifest.initial.concat(manifest.game);
3 |
4 | var window = this;
5 |
6 | egret_native.setSearchPaths([""]);
7 |
8 | egret_native.requireFiles = function () {
9 | for (var key in game_file_list) {
10 | var src = game_file_list[key];
11 | require(src);
12 | }
13 | };
14 |
15 | egret_native.egretInit = function () {
16 | if(egret_native.featureEnable) {
17 | //控制一些优化方案是否开启
18 | //Control whether some optimization options are open
19 | var result = egret_native.featureEnable({
20 |
21 | });
22 | }
23 | egret_native.requireFiles();
24 | egret.dom = {};
25 | egret.dom.drawAsCanvas = function () {
26 | };
27 | };
28 |
29 | egret_native.egretStart = function () {
30 | var option = {
31 | //以下为自动修改,请勿修改
32 | //The following is automatically modified, please do not modify
33 | //----auto option start----
34 | entryClassName: "Main",
35 | frameRate: 60,
36 | scaleMode: "fixedWidth",
37 | contentWidth: 480,
38 | contentHeight: 640,
39 | showPaintRect: false,
40 | showFPS: false,
41 | fpsStyles: "x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9",
42 | showLog: false,
43 | logFilter: "",
44 | maxTouches: 2,
45 | textureScaleFactor: 1
46 | //----auto option end----
47 | };
48 |
49 | egret.native.NativePlayer.option = option;
50 | egret.runEgret();
51 | egret_native.Label.createLabel("/system/fonts/DroidSansFallback.ttf", 20, "", 0);
52 | egret_native.EGTView.preSetOffScreenBufferEnable(true);
53 | };
--------------------------------------------------------------------------------
/src/game/layer/StartGameLayer.ts:
--------------------------------------------------------------------------------
1 | /**游戏开始场景 */
2 | class StartGameLayer extends egret.Sprite {
3 | /**开始按钮 */
4 | private startBtn:MyButton;
5 | /**更多按钮 */
6 | private moreBtn:MyButton;
7 | /**LOGO */
8 | private titleImage:egret.Bitmap;
9 | public constructor() {
10 | super();
11 | this.init();
12 | }
13 | private init():void {
14 | /**添加游戏LOGO */
15 | this.titleImage = GameConst.createBitmapFromSheet("logo_mishitaosheng", "ui");
16 | this.titleImage.x = 51;
17 | this.titleImage.y = 161;
18 | this.addChild(this.titleImage);
19 | //开始按钮设置
20 | this.startBtn = new MyButton("btn_y", "btn_kaishi");
21 | this.addChild(this.startBtn);
22 | this.startBtn.x = (GameConst.StageW - this.startBtn.width) / 2;
23 | this.startBtn.y = GameConst.StageH / 2 - 75;
24 | this.startBtn.setClick(this.onStartGameClick);
25 | //更多按钮设置
26 | this.moreBtn = new MyButton("btn_b", "btn_gengduo");
27 | this.moreBtn.x = (GameConst.StageW - this.startBtn.width) / 2;
28 | this.moreBtn.y =GameConst.StageH / 2 + 75;
29 | this.addChild(this.moreBtn);
30 | this.moreBtn.setClick(this.onMoreBtnClick);
31 | //文本
32 | let tex:egret.TextField = new egret.TextField();
33 | tex.width = GameConst.StageW;
34 | tex.textAlign = egret.HorizontalAlign.CENTER;
35 | tex.strokeColor = 0x403e3e;
36 | tex.stroke = 1;
37 | tex.bold = true;
38 | tex.y = GameConst.StageH / 2 + 250;
39 | tex.text = "Egret";
40 | this.addChild(tex);
41 | }
42 | private onStartGameClick() {
43 | GameControl.Instance.onGameScenesHandler();
44 | }
45 | private onMoreBtnClick() {
46 | console.log("更多游戏");
47 | platform.GetInfo();
48 | }
49 | }
--------------------------------------------------------------------------------
/bin-debug/game/comment/SpecialNumber.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**特殊字符数字类 */
12 | var SpecialNumber = (function (_super) {
13 | __extends(SpecialNumber, _super);
14 | function SpecialNumber() {
15 | var _this = _super.call(this) || this;
16 | _this.gap = 0;
17 | return _this;
18 | }
19 | /**设置显示的字符串 */
20 | SpecialNumber.prototype.setData = function (str) {
21 | this.clear();
22 | if (str == "" || str == null) {
23 | return;
24 | }
25 | //把所有数字每一个都存进数组中
26 | var chars = str.split("");
27 | var w = 0;
28 | //所有的长度
29 | var length = chars.length;
30 | for (var i = 0; i < length; i++) {
31 | try {
32 | var image = GameConst.createBitmapFromSheet(chars[i], "ui");
33 | if (image) {
34 | image.x = w;
35 | w += image.width + this.gap;
36 | this.addChild(image);
37 | }
38 | }
39 | catch (error) {
40 | console.log(error);
41 | }
42 | }
43 | this.anchorOffsetX = this.width / 2;
44 | };
45 | SpecialNumber.prototype.clear = function () {
46 | while (this.numChildren) {
47 | this.removeChildAt(0);
48 | }
49 | };
50 | return SpecialNumber;
51 | }(egret.DisplayObjectContainer));
52 | __reflect(SpecialNumber.prototype, "SpecialNumber");
53 |
--------------------------------------------------------------------------------
/bin-debug/game/comment/MyButton.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**自定义按钮类 */
12 | var MyButton = (function (_super) {
13 | __extends(MyButton, _super);
14 | function MyButton(bgName, titleName) {
15 | var _this = _super.call(this) || this;
16 | _this._bg = GameConst.createBitmapFromSheet(bgName, "ui");
17 | _this.addChild(_this._bg);
18 | _this.title = GameConst.createBitmapFromSheet(titleName, "ui");
19 | _this.title.x = (_this._bg.width - _this.title.width) >> 1;
20 | _this.title.y = (_this._bg.height - _this.title.height) >> 1;
21 | _this.addChild(_this.title);
22 | return _this;
23 | }
24 | //设置点击触发事件
25 | MyButton.prototype.setClick = function (func) {
26 | this.touchEnabled = true;
27 | this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClickEvent, this);
28 | this.onClick = func;
29 | };
30 | //点击触发的事件
31 | MyButton.prototype.onClickEvent = function () {
32 | this.onClick();
33 | };
34 | MyButton.prototype.setTitle = function (title) {
35 | this.title = GameConst.CreateBitmapByName(title);
36 | };
37 | Object.defineProperty(MyButton.prototype, "bg", {
38 | get: function () {
39 | return this._bg;
40 | },
41 | set: function (bg) {
42 | this._bg = bg;
43 | },
44 | enumerable: true,
45 | configurable: true
46 | });
47 | return MyButton;
48 | }(egret.Sprite));
49 | __reflect(MyButton.prototype, "MyButton");
50 |
--------------------------------------------------------------------------------
/scripts/bricks/bricks.ts:
--------------------------------------------------------------------------------
1 | import * as fs from 'fs';
2 | import * as path from 'path';
3 |
4 |
5 | type ManifestConfig = {
6 |
7 | initial: string[],
8 |
9 | game: string[]
10 |
11 | }
12 |
13 | export class BricksPlugin implements plugins.Command {
14 |
15 | constructor() {
16 | }
17 | async onFile(file: plugins.File) {
18 | const filename = file.origin;
19 | if (filename == 'manifest.json') {
20 | const contents = file.contents.toString();
21 | const jsonData: ManifestConfig = JSON.parse(contents);
22 |
23 | let content = '';
24 | content += `BK.Script.loadlib("GameRes://js/promise.js");\n`;
25 | for (let item of jsonData.initial) {
26 | if (item != 'js/promise.js' && item != 'js/promise.min.js') {
27 | content += `BK.Script.loadlib("GameRes://${item}");\n`
28 | }
29 | if (item == "js/egret.js" || item == 'js/egret.min.js') {
30 | content += `BK.Script.loadlib("GameRes://egret.bricks.js");\n`
31 | }
32 | }
33 | for (let item of jsonData.game) {
34 | content += `BK.Script.loadlib("GameRes://${item}");\n`
35 | }
36 | file.path = file.dirname + '/manifest.js'
37 | file.contents = new Buffer(content);
38 | } else if (filename == 'main.js') {
39 | const content = file.contents.toString();
40 | let result = content.replace(/RES\.loadConfig\("resource\/default\.res\.json", "resource\/"\)/gm, 'RES.loadConfig("GameRes://resource/default.res.json", "GameRes://resource/")');
41 | result = result.replace(/eui\.Theme\("resource\/default\.thm\.json", _this\.stage\)/gm, 'eui.Theme("GameRes://resource/default.thm.json", _this.stage)');
42 | result += ";global.Main = Main;";
43 | file.path = file.dirname + '/main.js'
44 | file.contents = new Buffer(result);
45 | }
46 | return file;
47 | }
48 | async onFinish(pluginContext) {
49 |
50 | }
51 | }
--------------------------------------------------------------------------------
/scripts/config.wxgame.ts:
--------------------------------------------------------------------------------
1 | /// 阅读 api.d.ts 查看文档
2 | ///
3 |
4 | import * as path from 'path';
5 | import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
6 | import { WxgamePlugin } from './wxgame/wxgame';
7 | import { CustomPlugin } from './myplugin';
8 | import * as defaultConfig from './config';
9 |
10 | const config: ResourceManagerConfig = {
11 |
12 | buildConfig: (params) => {
13 |
14 | const { target, command, projectName, version } = params;
15 | const outputDir = `../${projectName}_wxgame`;
16 | if (command == 'build') {
17 | return {
18 | outputDir,
19 | commands: [
20 | new CleanPlugin({ matchers: ["js", "resource"] }),
21 | new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
22 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
23 | new WxgamePlugin(),
24 | new ManifestPlugin({ output: 'manifest.js' })
25 | ]
26 | }
27 | }
28 | else if (command == 'publish') {
29 | return {
30 | outputDir,
31 | commands: [
32 | new CleanPlugin({ matchers: ["js", "resource"] }),
33 | new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
34 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
35 | new WxgamePlugin(),
36 | new UglifyPlugin([{
37 | sources: ["main.js"],
38 | target: "main.min.js"
39 | }
40 | ]),
41 | new ManifestPlugin({ output: 'manifest.js' })
42 | ]
43 | }
44 | }
45 | else {
46 | throw `unknown command : ${params.command}`;
47 | }
48 | },
49 |
50 | mergeSelector: defaultConfig.mergeSelector,
51 |
52 | typeSelector: defaultConfig.typeSelector
53 | }
54 |
55 |
56 |
57 | export = config;
58 |
--------------------------------------------------------------------------------
/src/game/GameControl.ts:
--------------------------------------------------------------------------------
1 | /**游戏管理 */
2 | class GameControl extends egret.Sprite {
3 | private static _instance:GameControl;
4 | public static get Instance() {
5 | if(!GameControl._instance) {
6 | GameControl._instance = new GameControl();
7 | }
8 | return GameControl._instance;
9 | }
10 | /**当前场景 */
11 | private currentStage:egret.DisplayObjectContainer;
12 | //开始游戏
13 | private startGame:StartGameLayer;
14 | /**游戏场景 */
15 | private gameScenes:GameScenesLayer;
16 | /**结束场景 */
17 | private overScenes:GameOverLayer;
18 | /**背景 */
19 | private bgImg:egret.Bitmap;
20 | public constructor() {
21 | super();
22 | this.startGame = new StartGameLayer();
23 | this.gameScenes = new GameScenesLayer();
24 | this.overScenes = new GameOverLayer();
25 | }
26 |
27 | public setStageHandler(stage:egret.DisplayObjectContainer):void {
28 | /**设置当前场景的背景 */
29 | this.currentStage = stage;
30 | this.bgImg = GameConst.CreateBitmapByName("bg_jpg");
31 | this.bgImg.width = GameConst.StageW;
32 | this.bgImg.height = GameConst.StageH;
33 | //把背景添加到当期场景
34 | this.currentStage.addChild(this.bgImg);
35 | }
36 | /**开始游戏的场景 */
37 | public startGameHandler():void {
38 | if(this.gameScenes && this.gameScenes.parent) {
39 | GameConst.removeChild(this.gameScenes);
40 | }
41 | if(this.gameScenes && this.overScenes.parent) {
42 | GameConst.removeChild(this.overScenes);
43 | }
44 | this.currentStage.addChild(this.startGame);
45 | GameApp.xia.visible = true;
46 | }
47 |
48 | /**游戏场景 */
49 | public onGameScenesHandler():void {
50 | if(this.startGame && this.startGame.parent) {
51 | GameConst.removeChild(this.startGame);
52 | }
53 | if(this.overScenes && this.overScenes.parent) {
54 | GameConst.removeChild(this.overScenes);
55 | }
56 | this.currentStage.addChild(this.gameScenes);
57 | GameApp.xia.visible = false;
58 | }
59 |
60 | /**游戏结束场景 */
61 | public showGameOverSceneHandler():void{
62 | if(this.startGame && this.startGame.parent){
63 | GameConst.removeChild(this.startGame)
64 | }
65 | if(this.gameScenes && this.gameScenes.parent){
66 | GameConst.removeChild(this.gameScenes)
67 | }
68 | this.currentStage.addChild(this.overScenes);
69 | GameApp.xia.visible = true;
70 | }
71 |
72 | public getGameOverDisplay():GameOverLayer {
73 | return this.overScenes;
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/bin-debug/game/layer/StartGameLayer.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**游戏开始场景 */
12 | var StartGameLayer = (function (_super) {
13 | __extends(StartGameLayer, _super);
14 | function StartGameLayer() {
15 | var _this = _super.call(this) || this;
16 | _this.init();
17 | return _this;
18 | }
19 | StartGameLayer.prototype.init = function () {
20 | /**添加游戏LOGO */
21 | this.titleImage = GameConst.createBitmapFromSheet("logo_mishitaosheng", "ui");
22 | this.titleImage.x = 51;
23 | this.titleImage.y = 161;
24 | this.addChild(this.titleImage);
25 | //开始按钮设置
26 | this.startBtn = new MyButton("btn_y", "btn_kaishi");
27 | this.addChild(this.startBtn);
28 | this.startBtn.x = (GameConst.StageW - this.startBtn.width) / 2;
29 | this.startBtn.y = GameConst.StageH / 2 - 75;
30 | this.startBtn.setClick(this.onStartGameClick);
31 | //更多按钮设置
32 | this.moreBtn = new MyButton("btn_b", "btn_gengduo");
33 | this.moreBtn.x = (GameConst.StageW - this.startBtn.width) / 2;
34 | this.moreBtn.y = GameConst.StageH / 2 + 75;
35 | this.addChild(this.moreBtn);
36 | this.moreBtn.setClick(this.onMoreBtnClick);
37 | //文本
38 | var tex = new egret.TextField();
39 | tex.width = GameConst.StageW;
40 | tex.textAlign = egret.HorizontalAlign.CENTER;
41 | tex.strokeColor = 0x403e3e;
42 | tex.stroke = 1;
43 | tex.bold = true;
44 | tex.y = GameConst.StageH / 2 + 250;
45 | tex.text = "Egret";
46 | this.addChild(tex);
47 | };
48 | StartGameLayer.prototype.onStartGameClick = function () {
49 | GameControl.Instance.onGameScenesHandler();
50 | };
51 | StartGameLayer.prototype.onMoreBtnClick = function () {
52 | console.log("更多游戏");
53 | platform.GetInfo();
54 | };
55 | return StartGameLayer;
56 | }(egret.Sprite));
57 | __reflect(StartGameLayer.prototype, "StartGameLayer");
58 |
--------------------------------------------------------------------------------
/resource/assets/game/role/Sprites.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "Sprites.png"
3 | ,
4 | "frames": {
5 | "0020001": {"x":300, "y":100, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
6 | "0020002": {"x":300, "y":0, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
7 | "0020003": {"x":361, "y":88, "w":59, "h":88, "offX":21,"offY":45,"sourceW":100,"sourceH":150},
8 | "0020004": {"x":231, "y":0, "w":68, "h":79, "offX":18,"offY":54,"sourceW":100,"sourceH":150},
9 | "0020005": {"x":232, "y":174, "w":66, "h":80, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
10 | "0020006": {"x":230, "y":94, "w":69, "h":79, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
11 | "0020007": {"x":361, "y":0, "w":59, "h":87, "offX":24,"offY":46,"sourceW":100,"sourceH":150},
12 | "0020008": {"x":80, "y":79, "w":76, "h":66, "offX":13,"offY":68,"sourceW":100,"sourceH":150},
13 | "0020009": {"x":0, "y":0, "w":80, "h":42, "offX":16,"offY":92,"sourceW":100,"sourceH":150},
14 | "0020010": {"x":0, "y":185, "w":79, "h":43, "offX":13,"offY":90,"sourceW":100,"sourceH":150},
15 | "0020011": {"x":0, "y":229, "w":79, "h":82, "offX":6,"offY":54,"sourceW":100,"sourceH":150},
16 | "0020012": {"x":79, "y":312, "w":78, "h":82, "offX":17,"offY":54,"sourceW":100,"sourceH":150},
17 | "0020013": {"x":80, "y":146, "w":75, "h":74, "offX":19,"offY":59,"sourceW":100,"sourceH":150},
18 | "0020014": {"x":80, "y":221, "w":75, "h":74, "offX":9,"offY":59,"sourceW":100,"sourceH":150},
19 | "0020015": {"x":156, "y":146, "w":73, "h":93, "offX":15,"offY":40,"sourceW":100,"sourceH":150},
20 | "0020016": {"x":157, "y":0, "w":73, "h":93, "offX":16,"offY":40,"sourceW":100,"sourceH":150},
21 | "0020017": {"x":0, "y":312, "w":78, "h":107, "offX":13,"offY":26,"sourceW":100,"sourceH":150},
22 | "0020018": {"x":158, "y":240, "w":73, "h":107, "offX":15,"offY":26,"sourceW":100,"sourceH":150},
23 | "0020019": {"x":232, "y":255, "w":64, "h":103, "offX":27,"offY":31,"sourceW":100,"sourceH":150},
24 | "0020020": {"x":297, "y":255, "w":64, "h":104, "offX":13,"offY":30,"sourceW":100,"sourceH":150},
25 | "xue0001": {"x":79, "y":411, "w":72, "h":7, "offX":14,"offY":14,"sourceW":100,"sourceH":100},
26 | "xue0002": {"x":79, "y":395, "w":76, "h":15, "offX":12,"offY":14,"sourceW":100,"sourceH":100},
27 | "xue0003": {"x":80, "y":43, "w":76, "h":35, "offX":11,"offY":15,"sourceW":100,"sourceH":100},
28 | "xue0004": {"x":0, "y":122, "w":79, "h":62, "offX":8,"offY":15,"sourceW":100,"sourceH":100},
29 | "xue0005": {"x":0, "y":43, "w":79, "h":78, "offX":7,"offY":15,"sourceW":100,"sourceH":100}
30 |
31 | }}
--------------------------------------------------------------------------------
/resource/default.res.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "keys": "egret_icon_png,description_json,newAssets_json,bg_jpg,bg_qiang_png,btn_rank_png,egret_icon2_png,loading_bg_jpg,loading_logo_png,pengyouquan_png,shang_jpg,xia_jpg,ui_json,ui_png,Sprites_json",
5 | "name": "preload"
6 | }
7 | ],
8 | "resources": [
9 | {
10 | "url": "assets/egret_icon.png",
11 | "type": "image",
12 | "name": "egret_icon_png"
13 | },
14 | {
15 | "url": "config/description.json",
16 | "type": "json",
17 | "name": "description_json"
18 | },
19 | {
20 | "url": "assets/game/role/newAssets.json",
21 | "type": "sheet",
22 | "name": "newAssets_json",
23 | "subkeys": "1ci,1ci_light,2ci,2ci_light,3ci,3ci_light,framebg,fuhuo,jieshu,wudi"
24 | },
25 | {
26 | "url": "assets/game/bg.jpg",
27 | "type": "image",
28 | "name": "bg_jpg"
29 | },
30 | {
31 | "url": "assets/game/bg_qiang.png",
32 | "type": "image",
33 | "name": "bg_qiang_png"
34 | },
35 | {
36 | "url": "assets/game/btn_rank.png",
37 | "type": "image",
38 | "name": "btn_rank_png"
39 | },
40 | {
41 | "url": "assets/game/egret_icon.png",
42 | "type": "image",
43 | "name": "egret_icon2_png"
44 | },
45 | {
46 | "url": "assets/game/loading_bg.jpg",
47 | "type": "image",
48 | "name": "loading_bg_jpg"
49 | },
50 | {
51 | "url": "assets/game/loading_logo.png",
52 | "type": "image",
53 | "name": "loading_logo_png"
54 | },
55 | {
56 | "url": "assets/game/pengyouquan.png",
57 | "type": "image",
58 | "name": "pengyouquan_png"
59 | },
60 | {
61 | "url": "assets/game/shang.jpg",
62 | "type": "image",
63 | "name": "shang_jpg"
64 | },
65 | {
66 | "url": "assets/game/xia.jpg",
67 | "type": "image",
68 | "name": "xia_jpg"
69 | },
70 | {
71 | "url": "assets/game/ui/ui.json",
72 | "type": "sheet",
73 | "name": "ui_json",
74 | "subkeys": "0,1,2,3,4,5,6,7,8,9,bg_shangkuang,bg_wenzi,btn_b,btn_gengduo,btn_kaishi,btn_xuanya,btn_y,btn_zaiwan,egret_icon,fenshu,guanqia,kuang,kuang2,logo_mishitaosheng,shibai,xin,zuigaojilu"
75 | },
76 | {
77 | "url": "assets/game/ui/ui.png",
78 | "type": "image",
79 | "name": "ui_png"
80 | },
81 | {
82 | "url": "assets/game/role/Sprites.json",
83 | "type": "sheet",
84 | "name": "Sprites_json",
85 | "subkeys": "0020001,0020002,0020003,0020004,0020005,0020006,0020007,0020008,0020009,0020010,0020011,0020012,0020013,0020014,0020015,0020016,0020017,0020018,0020019,0020020,xue0001,xue0002,xue0003,xue0004,xue0005"
86 | }
87 | ]
88 | }
--------------------------------------------------------------------------------
/src/LoadingUI.ts:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 |
30 | class LoadingUI extends egret.Sprite implements RES.PromiseTaskReporter {
31 |
32 | public constructor() {
33 | super();
34 | this.createView();
35 | }
36 |
37 | private textField: egret.TextField;
38 |
39 | private createView(): void {
40 | this.textField = new egret.TextField();
41 | this.addChild(this.textField);
42 | this.textField.y = 300;
43 | this.textField.width = 480;
44 | this.textField.height = 100;
45 | this.textField.textAlign = "center";
46 | }
47 |
48 | public onProgress(current: number, total: number): void {
49 | this.textField.text = `Loading...${current}/${total}`;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/role/Sprites.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "Sprites.png"
3 | ,
4 | "frames": {
5 | "0020001": {"x":300, "y":100, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
6 | "0020002": {"x":300, "y":0, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
7 | "0020003": {"x":361, "y":88, "w":59, "h":88, "offX":21,"offY":45,"sourceW":100,"sourceH":150},
8 | "0020004": {"x":231, "y":0, "w":68, "h":79, "offX":18,"offY":54,"sourceW":100,"sourceH":150},
9 | "0020005": {"x":232, "y":174, "w":66, "h":80, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
10 | "0020006": {"x":230, "y":94, "w":69, "h":79, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
11 | "0020007": {"x":361, "y":0, "w":59, "h":87, "offX":24,"offY":46,"sourceW":100,"sourceH":150},
12 | "0020008": {"x":80, "y":79, "w":76, "h":66, "offX":13,"offY":68,"sourceW":100,"sourceH":150},
13 | "0020009": {"x":0, "y":0, "w":80, "h":42, "offX":16,"offY":92,"sourceW":100,"sourceH":150},
14 | "0020010": {"x":0, "y":185, "w":79, "h":43, "offX":13,"offY":90,"sourceW":100,"sourceH":150},
15 | "0020011": {"x":0, "y":229, "w":79, "h":82, "offX":6,"offY":54,"sourceW":100,"sourceH":150},
16 | "0020012": {"x":79, "y":312, "w":78, "h":82, "offX":17,"offY":54,"sourceW":100,"sourceH":150},
17 | "0020013": {"x":80, "y":146, "w":75, "h":74, "offX":19,"offY":59,"sourceW":100,"sourceH":150},
18 | "0020014": {"x":80, "y":221, "w":75, "h":74, "offX":9,"offY":59,"sourceW":100,"sourceH":150},
19 | "0020015": {"x":156, "y":146, "w":73, "h":93, "offX":15,"offY":40,"sourceW":100,"sourceH":150},
20 | "0020016": {"x":157, "y":0, "w":73, "h":93, "offX":16,"offY":40,"sourceW":100,"sourceH":150},
21 | "0020017": {"x":0, "y":312, "w":78, "h":107, "offX":13,"offY":26,"sourceW":100,"sourceH":150},
22 | "0020018": {"x":158, "y":240, "w":73, "h":107, "offX":15,"offY":26,"sourceW":100,"sourceH":150},
23 | "0020019": {"x":232, "y":255, "w":64, "h":103, "offX":27,"offY":31,"sourceW":100,"sourceH":150},
24 | "0020020": {"x":297, "y":255, "w":64, "h":104, "offX":13,"offY":30,"sourceW":100,"sourceH":150},
25 | "xue0001": {"x":79, "y":411, "w":72, "h":7, "offX":14,"offY":14,"sourceW":100,"sourceH":100},
26 | "xue0002": {"x":79, "y":395, "w":76, "h":15, "offX":12,"offY":14,"sourceW":100,"sourceH":100},
27 | "xue0003": {"x":80, "y":43, "w":76, "h":35, "offX":11,"offY":15,"sourceW":100,"sourceH":100},
28 | "xue0004": {"x":0, "y":122, "w":79, "h":62, "offX":8,"offY":15,"sourceW":100,"sourceH":100},
29 | "xue0005": {"x":0, "y":43, "w":79, "h":78, "offX":7,"offY":15,"sourceW":100,"sourceH":100}
30 |
31 | }}
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/default.res.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "keys": "egret_icon_png,description_json,newAssets_json,bg_jpg,bg_qiang_png,btn_rank_png,egret_icon2_png,loading_bg_jpg,loading_logo_png,pengyouquan_png,shang_jpg,xia_jpg,ui_json,ui_png,Sprites_json",
5 | "name": "preload"
6 | }
7 | ],
8 | "resources": [
9 | {
10 | "url": "assets/egret_icon.png",
11 | "type": "image",
12 | "name": "egret_icon_png"
13 | },
14 | {
15 | "url": "config/description.json",
16 | "type": "json",
17 | "name": "description_json"
18 | },
19 | {
20 | "url": "assets/game/role/newAssets.json",
21 | "type": "sheet",
22 | "name": "newAssets_json",
23 | "subkeys": "1ci,1ci_light,2ci,2ci_light,3ci,3ci_light,framebg,fuhuo,jieshu,wudi"
24 | },
25 | {
26 | "url": "assets/game/bg.jpg",
27 | "type": "image",
28 | "name": "bg_jpg"
29 | },
30 | {
31 | "url": "assets/game/bg_qiang.png",
32 | "type": "image",
33 | "name": "bg_qiang_png"
34 | },
35 | {
36 | "url": "assets/game/btn_rank.png",
37 | "type": "image",
38 | "name": "btn_rank_png"
39 | },
40 | {
41 | "url": "assets/game/egret_icon.png",
42 | "type": "image",
43 | "name": "egret_icon2_png"
44 | },
45 | {
46 | "url": "assets/game/loading_bg.jpg",
47 | "type": "image",
48 | "name": "loading_bg_jpg"
49 | },
50 | {
51 | "url": "assets/game/loading_logo.png",
52 | "type": "image",
53 | "name": "loading_logo_png"
54 | },
55 | {
56 | "url": "assets/game/pengyouquan.png",
57 | "type": "image",
58 | "name": "pengyouquan_png"
59 | },
60 | {
61 | "url": "assets/game/shang.jpg",
62 | "type": "image",
63 | "name": "shang_jpg"
64 | },
65 | {
66 | "url": "assets/game/xia.jpg",
67 | "type": "image",
68 | "name": "xia_jpg"
69 | },
70 | {
71 | "url": "assets/game/ui/ui.json",
72 | "type": "sheet",
73 | "name": "ui_json",
74 | "subkeys": "0,1,2,3,4,5,6,7,8,9,bg_shangkuang,bg_wenzi,btn_b,btn_gengduo,btn_kaishi,btn_xuanya,btn_y,btn_zaiwan,egret_icon,fenshu,guanqia,kuang,kuang2,logo_mishitaosheng,shibai,xin,zuigaojilu"
75 | },
76 | {
77 | "url": "assets/game/ui/ui.png",
78 | "type": "image",
79 | "name": "ui_png"
80 | },
81 | {
82 | "url": "assets/game/role/Sprites.json",
83 | "type": "sheet",
84 | "name": "Sprites_json",
85 | "subkeys": "0020001,0020002,0020003,0020004,0020005,0020006,0020007,0020008,0020009,0020010,0020011,0020012,0020013,0020014,0020015,0020016,0020017,0020018,0020019,0020020,xue0001,xue0002,xue0003,xue0004,xue0005"
86 | }
87 | ]
88 | }
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/role/Sprites.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "Sprites.png"
3 | ,
4 | "frames": {
5 | "0020001": {"x":300, "y":100, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
6 | "0020002": {"x":300, "y":0, "w":60, "h":99, "offX":22,"offY":34,"sourceW":100,"sourceH":150},
7 | "0020003": {"x":361, "y":88, "w":59, "h":88, "offX":21,"offY":45,"sourceW":100,"sourceH":150},
8 | "0020004": {"x":231, "y":0, "w":68, "h":79, "offX":18,"offY":54,"sourceW":100,"sourceH":150},
9 | "0020005": {"x":232, "y":174, "w":66, "h":80, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
10 | "0020006": {"x":230, "y":94, "w":69, "h":79, "offX":19,"offY":54,"sourceW":100,"sourceH":150},
11 | "0020007": {"x":361, "y":0, "w":59, "h":87, "offX":24,"offY":46,"sourceW":100,"sourceH":150},
12 | "0020008": {"x":80, "y":79, "w":76, "h":66, "offX":13,"offY":68,"sourceW":100,"sourceH":150},
13 | "0020009": {"x":0, "y":0, "w":80, "h":42, "offX":16,"offY":92,"sourceW":100,"sourceH":150},
14 | "0020010": {"x":0, "y":185, "w":79, "h":43, "offX":13,"offY":90,"sourceW":100,"sourceH":150},
15 | "0020011": {"x":0, "y":229, "w":79, "h":82, "offX":6,"offY":54,"sourceW":100,"sourceH":150},
16 | "0020012": {"x":79, "y":312, "w":78, "h":82, "offX":17,"offY":54,"sourceW":100,"sourceH":150},
17 | "0020013": {"x":80, "y":146, "w":75, "h":74, "offX":19,"offY":59,"sourceW":100,"sourceH":150},
18 | "0020014": {"x":80, "y":221, "w":75, "h":74, "offX":9,"offY":59,"sourceW":100,"sourceH":150},
19 | "0020015": {"x":156, "y":146, "w":73, "h":93, "offX":15,"offY":40,"sourceW":100,"sourceH":150},
20 | "0020016": {"x":157, "y":0, "w":73, "h":93, "offX":16,"offY":40,"sourceW":100,"sourceH":150},
21 | "0020017": {"x":0, "y":312, "w":78, "h":107, "offX":13,"offY":26,"sourceW":100,"sourceH":150},
22 | "0020018": {"x":158, "y":240, "w":73, "h":107, "offX":15,"offY":26,"sourceW":100,"sourceH":150},
23 | "0020019": {"x":232, "y":255, "w":64, "h":103, "offX":27,"offY":31,"sourceW":100,"sourceH":150},
24 | "0020020": {"x":297, "y":255, "w":64, "h":104, "offX":13,"offY":30,"sourceW":100,"sourceH":150},
25 | "xue0001": {"x":79, "y":411, "w":72, "h":7, "offX":14,"offY":14,"sourceW":100,"sourceH":100},
26 | "xue0002": {"x":79, "y":395, "w":76, "h":15, "offX":12,"offY":14,"sourceW":100,"sourceH":100},
27 | "xue0003": {"x":80, "y":43, "w":76, "h":35, "offX":11,"offY":15,"sourceW":100,"sourceH":100},
28 | "xue0004": {"x":0, "y":122, "w":79, "h":62, "offX":8,"offY":15,"sourceW":100,"sourceH":100},
29 | "xue0005": {"x":0, "y":43, "w":79, "h":78, "offX":7,"offY":15,"sourceW":100,"sourceH":100}
30 |
31 | }}
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/default.res.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "keys": "egret_icon_png,description_json,newAssets_json,bg_jpg,bg_qiang_png,btn_rank_png,egret_icon2_png,loading_bg_jpg,loading_logo_png,pengyouquan_png,shang_jpg,xia_jpg,ui_json,ui_png,Sprites_json",
5 | "name": "preload"
6 | }
7 | ],
8 | "resources": [
9 | {
10 | "url": "assets/egret_icon.png",
11 | "type": "image",
12 | "name": "egret_icon_png"
13 | },
14 | {
15 | "url": "config/description.json",
16 | "type": "json",
17 | "name": "description_json"
18 | },
19 | {
20 | "url": "assets/game/role/newAssets.json",
21 | "type": "sheet",
22 | "name": "newAssets_json",
23 | "subkeys": "1ci,1ci_light,2ci,2ci_light,3ci,3ci_light,framebg,fuhuo,jieshu,wudi"
24 | },
25 | {
26 | "url": "assets/game/bg.jpg",
27 | "type": "image",
28 | "name": "bg_jpg"
29 | },
30 | {
31 | "url": "assets/game/bg_qiang.png",
32 | "type": "image",
33 | "name": "bg_qiang_png"
34 | },
35 | {
36 | "url": "assets/game/btn_rank.png",
37 | "type": "image",
38 | "name": "btn_rank_png"
39 | },
40 | {
41 | "url": "assets/game/egret_icon.png",
42 | "type": "image",
43 | "name": "egret_icon2_png"
44 | },
45 | {
46 | "url": "assets/game/loading_bg.jpg",
47 | "type": "image",
48 | "name": "loading_bg_jpg"
49 | },
50 | {
51 | "url": "assets/game/loading_logo.png",
52 | "type": "image",
53 | "name": "loading_logo_png"
54 | },
55 | {
56 | "url": "assets/game/pengyouquan.png",
57 | "type": "image",
58 | "name": "pengyouquan_png"
59 | },
60 | {
61 | "url": "assets/game/shang.jpg",
62 | "type": "image",
63 | "name": "shang_jpg"
64 | },
65 | {
66 | "url": "assets/game/xia.jpg",
67 | "type": "image",
68 | "name": "xia_jpg"
69 | },
70 | {
71 | "url": "assets/game/ui/ui.json",
72 | "type": "sheet",
73 | "name": "ui_json",
74 | "subkeys": "0,1,2,3,4,5,6,7,8,9,bg_shangkuang,bg_wenzi,btn_b,btn_gengduo,btn_kaishi,btn_xuanya,btn_y,btn_zaiwan,egret_icon,fenshu,guanqia,kuang,kuang2,logo_mishitaosheng,shibai,xin,zuigaojilu"
75 | },
76 | {
77 | "url": "assets/game/ui/ui.png",
78 | "type": "image",
79 | "name": "ui_png"
80 | },
81 | {
82 | "url": "assets/game/role/Sprites.json",
83 | "type": "sheet",
84 | "name": "Sprites_json",
85 | "subkeys": "0020001,0020002,0020003,0020004,0020005,0020006,0020007,0020008,0020009,0020010,0020011,0020012,0020013,0020014,0020015,0020016,0020017,0020018,0020019,0020020,xue0001,xue0002,xue0003,xue0004,xue0005"
86 | }
87 | ]
88 | }
--------------------------------------------------------------------------------
/resource/assets/game/ui/ui.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "ui.png"
3 | ,
4 | "frames": {
5 | "0": {"x":34, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
6 | "1": {"x":154, "y":615, "w":8, "h":22, "offX":0,"offY":0,"sourceW":8,"sourceH":22},
7 | "2": {"x":94, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
8 | "3": {"x":79, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
9 | "4": {"x":18, "y":616, "w":15, "h":22, "offX":0,"offY":0,"sourceW":15,"sourceH":22},
10 | "5": {"x":109, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
11 | "6": {"x":124, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
12 | "7": {"x":139, "y":615, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
13 | "8": {"x":49, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
14 | "9": {"x":64, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
15 | "bg_shangkuang": {"x":0, "y":0, "w":480, "h":78, "offX":0,"offY":0,"sourceW":480,"sourceH":78},
16 | "bg_wenzi": {"x":0, "y":181, "w":314, "h":322, "offX":0,"offY":0,"sourceW":314,"sourceH":322},
17 | "btn_b": {"x":0, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
18 | "btn_gengduo": {"x":270, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
19 | "btn_kaishi": {"x":135, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
20 | "btn_xuanya": {"x":0, "y":581, "w":134, "h":34, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
21 | "btn_y": {"x":219, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
22 | "btn_zaiwan": {"x":481, "y":0, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
23 | "egret_icon": {"x":315, "y":181, "w":218, "h":295, "offX":0,"offY":0,"sourceW":218,"sourceH":295},
24 | "fenshu": {"x":505, "y":141, "w":60, "h":29, "offX":2,"offY":2,"sourceW":64,"sourceH":33},
25 | "guanqia": {"x":534, "y":171, "w":59, "h":28, "offX":0,"offY":2,"sourceW":59,"sourceH":32},
26 | "kuang": {"x":369, "y":79, "w":135, "h":89, "offX":0,"offY":0,"sourceW":135,"sourceH":89},
27 | "kuang2": {"x":505, "y":65, "w":75, "h":75, "offX":0,"offY":0,"sourceW":75,"sourceH":75},
28 | "logo_mishitaosheng": {"x":0, "y":79, "w":368, "h":101, "offX":2,"offY":0,"sourceW":370,"sourceH":101},
29 | "shibai": {"x":438, "y":477, "w":176, "h":161, "offX":2,"offY":2,"sourceW":181,"sourceH":166},
30 | "xin": {"x":0, "y":616, "w":17, "h":14, "offX":4,"offY":3,"sourceW":26,"sourceH":19},
31 | "zuigaojilu": {"x":481, "y":34, "w":90, "h":30, "offX":1,"offY":2,"sourceW":91,"sourceH":34}
32 |
33 | }}
--------------------------------------------------------------------------------
/bin-release/web/101101/resource/assets/game/ui/ui.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "ui.png"
3 | ,
4 | "frames": {
5 | "0": {"x":34, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
6 | "1": {"x":154, "y":615, "w":8, "h":22, "offX":0,"offY":0,"sourceW":8,"sourceH":22},
7 | "2": {"x":94, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
8 | "3": {"x":79, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
9 | "4": {"x":18, "y":616, "w":15, "h":22, "offX":0,"offY":0,"sourceW":15,"sourceH":22},
10 | "5": {"x":109, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
11 | "6": {"x":124, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
12 | "7": {"x":139, "y":615, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
13 | "8": {"x":49, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
14 | "9": {"x":64, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
15 | "bg_shangkuang": {"x":0, "y":0, "w":480, "h":78, "offX":0,"offY":0,"sourceW":480,"sourceH":78},
16 | "bg_wenzi": {"x":0, "y":181, "w":314, "h":322, "offX":0,"offY":0,"sourceW":314,"sourceH":322},
17 | "btn_b": {"x":0, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
18 | "btn_gengduo": {"x":270, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
19 | "btn_kaishi": {"x":135, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
20 | "btn_xuanya": {"x":0, "y":581, "w":134, "h":34, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
21 | "btn_y": {"x":219, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
22 | "btn_zaiwan": {"x":481, "y":0, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
23 | "egret_icon": {"x":315, "y":181, "w":218, "h":295, "offX":0,"offY":0,"sourceW":218,"sourceH":295},
24 | "fenshu": {"x":505, "y":141, "w":60, "h":29, "offX":2,"offY":2,"sourceW":64,"sourceH":33},
25 | "guanqia": {"x":534, "y":171, "w":59, "h":28, "offX":0,"offY":2,"sourceW":59,"sourceH":32},
26 | "kuang": {"x":369, "y":79, "w":135, "h":89, "offX":0,"offY":0,"sourceW":135,"sourceH":89},
27 | "kuang2": {"x":505, "y":65, "w":75, "h":75, "offX":0,"offY":0,"sourceW":75,"sourceH":75},
28 | "logo_mishitaosheng": {"x":0, "y":79, "w":368, "h":101, "offX":2,"offY":0,"sourceW":370,"sourceH":101},
29 | "shibai": {"x":438, "y":477, "w":176, "h":161, "offX":2,"offY":2,"sourceW":181,"sourceH":166},
30 | "xin": {"x":0, "y":616, "w":17, "h":14, "offX":4,"offY":3,"sourceW":26,"sourceH":19},
31 | "zuigaojilu": {"x":481, "y":34, "w":90, "h":30, "offX":1,"offY":2,"sourceW":91,"sourceH":34}
32 |
33 | }}
--------------------------------------------------------------------------------
/bin-release/web/180824154858/resource/assets/game/ui/ui.json:
--------------------------------------------------------------------------------
1 | {
2 | "file": "ui.png"
3 | ,
4 | "frames": {
5 | "0": {"x":34, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
6 | "1": {"x":154, "y":615, "w":8, "h":22, "offX":0,"offY":0,"sourceW":8,"sourceH":22},
7 | "2": {"x":94, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
8 | "3": {"x":79, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
9 | "4": {"x":18, "y":616, "w":15, "h":22, "offX":0,"offY":0,"sourceW":15,"sourceH":22},
10 | "5": {"x":109, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
11 | "6": {"x":124, "y":616, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
12 | "7": {"x":139, "y":615, "w":14, "h":22, "offX":0,"offY":0,"sourceW":14,"sourceH":22},
13 | "8": {"x":49, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
14 | "9": {"x":64, "y":616, "w":14, "h":21, "offX":0,"offY":0,"sourceW":14,"sourceH":21},
15 | "bg_shangkuang": {"x":0, "y":0, "w":480, "h":78, "offX":0,"offY":0,"sourceW":480,"sourceH":78},
16 | "bg_wenzi": {"x":0, "y":181, "w":314, "h":322, "offX":0,"offY":0,"sourceW":314,"sourceH":322},
17 | "btn_b": {"x":0, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
18 | "btn_gengduo": {"x":270, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
19 | "btn_kaishi": {"x":135, "y":581, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
20 | "btn_xuanya": {"x":0, "y":581, "w":134, "h":34, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
21 | "btn_y": {"x":219, "y":504, "w":218, "h":76, "offX":0,"offY":0,"sourceW":218,"sourceH":76},
22 | "btn_zaiwan": {"x":481, "y":0, "w":134, "h":33, "offX":0,"offY":2,"sourceW":134,"sourceH":37},
23 | "egret_icon": {"x":315, "y":181, "w":218, "h":295, "offX":0,"offY":0,"sourceW":218,"sourceH":295},
24 | "fenshu": {"x":505, "y":141, "w":60, "h":29, "offX":2,"offY":2,"sourceW":64,"sourceH":33},
25 | "guanqia": {"x":534, "y":171, "w":59, "h":28, "offX":0,"offY":2,"sourceW":59,"sourceH":32},
26 | "kuang": {"x":369, "y":79, "w":135, "h":89, "offX":0,"offY":0,"sourceW":135,"sourceH":89},
27 | "kuang2": {"x":505, "y":65, "w":75, "h":75, "offX":0,"offY":0,"sourceW":75,"sourceH":75},
28 | "logo_mishitaosheng": {"x":0, "y":79, "w":368, "h":101, "offX":2,"offY":0,"sourceW":370,"sourceH":101},
29 | "shibai": {"x":438, "y":477, "w":176, "h":161, "offX":2,"offY":2,"sourceW":181,"sourceH":166},
30 | "xin": {"x":0, "y":616, "w":17, "h":14, "offX":4,"offY":3,"sourceW":26,"sourceH":19},
31 | "zuigaojilu": {"x":481, "y":34, "w":90, "h":30, "offX":1,"offY":2,"sourceW":91,"sourceH":34}
32 |
33 | }}
--------------------------------------------------------------------------------
/src/AssetAdapter.ts:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 |
30 |
31 | class AssetAdapter implements eui.IAssetAdapter {
32 | /**
33 | * @language zh_CN
34 | * 解析素材
35 | * @param source 待解析的新素材标识符
36 | * @param compFunc 解析完成回调函数,示例:callBack(content:any,source:string):void;
37 | * @param thisObject callBack的 this 引用
38 | */
39 | public getAsset(source: string, compFunc:Function, thisObject: any): void {
40 | function onGetRes(data: any): void {
41 | compFunc.call(thisObject, data, source);
42 | }
43 | if (RES.hasRes(source)) {
44 | let data = RES.getRes(source);
45 | if (data) {
46 | onGetRes(data);
47 | }
48 | else {
49 | RES.getResAsync(source, onGetRes, this);
50 | }
51 | }
52 | else {
53 | RES.getResByUrl(source, onGetRes, this, RES.ResourceItem.TYPE_IMAGE);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/game/layer/GameOverLayer.ts:
--------------------------------------------------------------------------------
1 | /**游戏结束 */
2 | class GameOverLayer extends egret.Sprite {
3 | public constructor() {
4 | super()
5 | this.init();
6 | }
7 | private scoreNum:SpecialNumber;
8 | private maxScore:SpecialNumber;
9 | private init() {
10 | //
11 | let bg_wenzi:egret.Bitmap = GameConst.createBitmapFromSheet("bg_wenzi", "ui");
12 | bg_wenzi.x = (GameConst.StageW - bg_wenzi.width) / 2;
13 | this.addChild(bg_wenzi);
14 | //失败
15 | let shibai:egret.Bitmap = GameConst.createBitmapFromSheet("shibai", "ui");
16 | shibai.x = (GameConst.StageW - shibai.width) / 2;
17 | shibai.y = 50;
18 | this.addChild(shibai);
19 |
20 | let fenshu:egret.Bitmap = GameConst.createBitmapFromSheet("fenshu", "ui");
21 | this.addChild(fenshu);
22 | fenshu.x = 120;
23 | fenshu.y = 238;
24 |
25 | let zuigaojilu:egret.Bitmap = GameConst.createBitmapFromSheet("zuigaojilu", "ui");
26 | zuigaojilu.x = 290;
27 | zuigaojilu.y = 238;
28 | this.addChild(zuigaojilu);
29 |
30 | /**再玩一局 */
31 | let btn_y:egret.Bitmap = GameConst.createBitmapFromSheet("btn_y", "ui");
32 | btn_y.anchorOffsetX = btn_y.width / 2;
33 | btn_y.anchorOffsetY = btn_y.height / 2;
34 | btn_y.x = GameConst.StageW / 2;
35 | btn_y.y = GameConst.StageH / 2 - 20;
36 | this.addChild(btn_y)
37 |
38 | let btn_zaiwan:egret.Bitmap = GameConst.createBitmapFromSheet("btn_zaiwan", "ui");
39 | btn_zaiwan.x = (GameConst.StageW - btn_zaiwan.width) / 2;
40 | btn_zaiwan.y = GameConst.StageH / 2 - 35;
41 | btn_zaiwan.touchEnabled = true;
42 | this.addChild(btn_zaiwan);
43 | /**炫耀一下 */
44 | let btn_b:egret.Bitmap = GameConst.createBitmapFromSheet("btn_b", "ui");
45 | btn_b.anchorOffsetX = btn_b.width / 2;
46 | btn_b.anchorOffsetY = btn_b.height / 2;
47 | btn_b.x = GameConst.StageW / 2;
48 | btn_b.y = GameConst.StageH / 2 + 145;
49 | this.addChild(btn_b);
50 | let btn_xuanya:egret.Bitmap = GameConst.createBitmapFromSheet("btn_xuanya", "ui");
51 | btn_xuanya.x = (GameConst.StageW - btn_zaiwan.width) / 2;
52 | btn_xuanya.y = GameConst.StageH / 2 + 130;
53 | btn_xuanya.touchEnabled = true;
54 | this.addChild(btn_xuanya);
55 |
56 | //分数
57 | this.scoreNum = new SpecialNumber();
58 | this.scoreNum.x = 138;
59 | this.scoreNum.y = 283;
60 | this.addChild(this.scoreNum);
61 | //最高分数
62 | this.maxScore = new SpecialNumber();
63 | this.maxScore.x = 330;
64 | this.maxScore.y = 283;
65 | this.addChild(this.maxScore);
66 | btn_zaiwan.addEventListener(egret.TouchEvent.TOUCH_TAP, (e:egret.TouchEvent)=>{
67 | //再来一局
68 | GameControl.Instance.onGameScenesHandler();
69 | }, this);
70 |
71 | btn_xuanya.addEventListener(egret.TouchEvent.TOUCH_TAP, ()=>{
72 | //分享
73 | platform.ShareMessage();
74 | }, this);
75 |
76 | }
77 | /**游戏结束页面分数最高分数 */
78 | public setGameOverDataHandler(score:number = 0, maxScore:number = 0):void {
79 | this.scoreNum.setData(score.toString());
80 | this.maxScore.setData(maxScore.toString());
81 | }
82 | }
--------------------------------------------------------------------------------
/bin-debug/AssetAdapter.js:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 | var __reflect = (this && this.__reflect) || function (p, c, t) {
30 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
31 | };
32 | var AssetAdapter = (function () {
33 | function AssetAdapter() {
34 | }
35 | /**
36 | * @language zh_CN
37 | * 解析素材
38 | * @param source 待解析的新素材标识符
39 | * @param compFunc 解析完成回调函数,示例:callBack(content:any,source:string):void;
40 | * @param thisObject callBack的 this 引用
41 | */
42 | AssetAdapter.prototype.getAsset = function (source, compFunc, thisObject) {
43 | function onGetRes(data) {
44 | compFunc.call(thisObject, data, source);
45 | }
46 | if (RES.hasRes(source)) {
47 | var data = RES.getRes(source);
48 | if (data) {
49 | onGetRes(data);
50 | }
51 | else {
52 | RES.getResAsync(source, onGetRes, this);
53 | }
54 | }
55 | else {
56 | RES.getResByUrl(source, onGetRes, this, RES.ResourceItem.TYPE_IMAGE);
57 | }
58 | };
59 | return AssetAdapter;
60 | }());
61 | __reflect(AssetAdapter.prototype, "AssetAdapter", ["eui.IAssetAdapter"]);
62 |
--------------------------------------------------------------------------------
/bin-debug/LoadingUI.js:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 | var __reflect = (this && this.__reflect) || function (p, c, t) {
30 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
31 | };
32 | var __extends = this && this.__extends || function __extends(t, e) {
33 | function r() {
34 | this.constructor = t;
35 | }
36 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
37 | r.prototype = e.prototype, t.prototype = new r();
38 | };
39 | var LoadingUI = (function (_super) {
40 | __extends(LoadingUI, _super);
41 | function LoadingUI() {
42 | var _this = _super.call(this) || this;
43 | _this.createView();
44 | return _this;
45 | }
46 | LoadingUI.prototype.createView = function () {
47 | this.textField = new egret.TextField();
48 | this.addChild(this.textField);
49 | this.textField.y = 300;
50 | this.textField.width = 480;
51 | this.textField.height = 100;
52 | this.textField.textAlign = "center";
53 | };
54 | LoadingUI.prototype.onProgress = function (current, total) {
55 | this.textField.text = "Loading..." + current + "/" + total;
56 | };
57 | return LoadingUI;
58 | }(egret.Sprite));
59 | __reflect(LoadingUI.prototype, "LoadingUI", ["RES.PromiseTaskReporter"]);
60 |
--------------------------------------------------------------------------------
/bin-debug/game/GameControl.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**游戏管理 */
12 | var GameControl = (function (_super) {
13 | __extends(GameControl, _super);
14 | function GameControl() {
15 | var _this = _super.call(this) || this;
16 | _this.startGame = new StartGameLayer();
17 | _this.gameScenes = new GameScenesLayer();
18 | _this.overScenes = new GameOverLayer();
19 | return _this;
20 | }
21 | Object.defineProperty(GameControl, "Instance", {
22 | get: function () {
23 | if (!GameControl._instance) {
24 | GameControl._instance = new GameControl();
25 | }
26 | return GameControl._instance;
27 | },
28 | enumerable: true,
29 | configurable: true
30 | });
31 | GameControl.prototype.setStageHandler = function (stage) {
32 | /**设置当前场景的背景 */
33 | this.currentStage = stage;
34 | this.bgImg = GameConst.CreateBitmapByName("bg_jpg");
35 | this.bgImg.width = GameConst.StageW;
36 | this.bgImg.height = GameConst.StageH;
37 | //把背景添加到当期场景
38 | this.currentStage.addChild(this.bgImg);
39 | };
40 | /**开始游戏的场景 */
41 | GameControl.prototype.startGameHandler = function () {
42 | if (this.gameScenes && this.gameScenes.parent) {
43 | GameConst.removeChild(this.gameScenes);
44 | }
45 | if (this.gameScenes && this.overScenes.parent) {
46 | GameConst.removeChild(this.overScenes);
47 | }
48 | this.currentStage.addChild(this.startGame);
49 | GameApp.xia.visible = true;
50 | };
51 | /**游戏场景 */
52 | GameControl.prototype.onGameScenesHandler = function () {
53 | if (this.startGame && this.startGame.parent) {
54 | GameConst.removeChild(this.startGame);
55 | }
56 | if (this.overScenes && this.overScenes.parent) {
57 | GameConst.removeChild(this.overScenes);
58 | }
59 | this.currentStage.addChild(this.gameScenes);
60 | GameApp.xia.visible = false;
61 | };
62 | /**游戏结束场景 */
63 | GameControl.prototype.showGameOverSceneHandler = function () {
64 | if (this.startGame && this.startGame.parent) {
65 | GameConst.removeChild(this.startGame);
66 | }
67 | if (this.gameScenes && this.gameScenes.parent) {
68 | GameConst.removeChild(this.gameScenes);
69 | }
70 | this.currentStage.addChild(this.overScenes);
71 | GameApp.xia.visible = true;
72 | };
73 | GameControl.prototype.getGameOverDisplay = function () {
74 | return this.overScenes;
75 | };
76 | return GameControl;
77 | }(egret.Sprite));
78 | __reflect(GameControl.prototype, "GameControl");
79 |
--------------------------------------------------------------------------------
/src/game/comment/Role.ts:
--------------------------------------------------------------------------------
1 | /**角色动作类 */
2 | class Role extends egret.Sprite{
3 | //状态
4 | public static STATE1:number = 0;
5 | public static STATE2:number = 1;
6 | public static STATE3:number = 2;
7 | public static STATE4:number = 3;
8 | public static STATE5:number = 4;
9 | /**人物状态集合 */
10 | public static FRAMES:Array = [
11 | ["0020003", "0020004", "0020005", "0020006","0020007"],
12 | ["0020008"],
13 | ["0020009", "0020010"],
14 | ["0020011", "0020012"],
15 | ["xue0001", "xue0002", "xue0003", "xue0004", "xue0005"]
16 | ]
17 | //身体
18 | private Body:egret.Bitmap;
19 | private state:number;
20 | private currFrames:Array;
21 | private currFramesIndex:number = 0;
22 | private runFlag:number;
23 | private isLoop:boolean;
24 |
25 | public constructor() {
26 | super();
27 | this.Body = new egret.Bitmap;
28 | //人物初始状态
29 | this.Body = GameConst.createBitmapFromSheet("Role.FRAMES[0][0]", "Sprites");
30 | //设置锚点
31 | this.Body.anchorOffsetX = this.Body.width * 0.5;
32 | this.addChild(this.Body);
33 | }
34 |
35 | /**设置状态 */
36 | public setState(state:number) :void {
37 | this.state = state;
38 | //死亡状态
39 | if(this.state == Role.STATE5) {
40 | this.isLoop = false;
41 | this.Body.anchorOffsetY = this.Body.height * 0;
42 | }else{
43 | this.isLoop = true;
44 | this.Body.anchorOffsetY = this.Body.height * 1;
45 | }
46 |
47 | if(this.state == Role.STATE3 || this.state == Role.STATE4){
48 | this.currFrames = [];
49 | if(Math.random() > 0.5){
50 | this.currFrames.push(Role.FRAMES[this.state][0]);
51 | }else{
52 | this.currFrames.push(Role.FRAMES[this.state][1]);
53 | }
54 | }else{
55 | this.currFrames = Role.FRAMES[this.state];
56 | }
57 | this.currFramesIndex = 0;
58 | this.setBody();
59 | }
60 |
61 | private setBody() {
62 | this.Body.texture = GameConst.getTextureFromSheet(this.currFrames[this.currFramesIndex], "Sprites");
63 | this.Body.anchorOffsetX = this.Body.width * 0.5;
64 | if(this.state == Role.STATE5){
65 | this.isLoop = false;
66 | this.Body.anchorOffsetY = this.Body.height * 0;
67 | }else{
68 | this.isLoop = true;
69 | this.Body.anchorOffsetY = this.Body.height * 1;
70 | }
71 | }
72 | public run():boolean{
73 | this.runFlag ++;
74 | if(this.runFlag > 4){
75 | this.runFlag = 0;
76 | }
77 | if(this.runFlag != 0){
78 | return;
79 | }
80 | var gotoFrameIndex:number = this.currFramesIndex + 1;
81 | if(gotoFrameIndex == this.currFrames.length){
82 | if(this.isLoop){
83 | gotoFrameIndex = 0;
84 | }else{
85 | gotoFrameIndex = this.currFramesIndex;
86 | }
87 | }
88 | if(gotoFrameIndex != this.currFramesIndex){
89 | this.currFramesIndex = gotoFrameIndex;
90 | this.setBody();
91 | }
92 | return false;
93 | }
94 |
95 | public play():void{
96 | egret.startTick(this.run,this);
97 | this.runFlag = 0;
98 | }
99 | public stop():void{
100 | egret.stopTick(this.run,this);
101 | }
102 | }
--------------------------------------------------------------------------------
/scripts/config.ts:
--------------------------------------------------------------------------------
1 | /// 阅读 api.d.ts 查看文档
2 | ///
3 |
4 | import * as path from 'path';
5 | import { UglifyPlugin, IncrementCompilePlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, RenamePlugin } from 'built-in';
6 | import { WxgamePlugin } from './wxgame/wxgame';
7 | import { BricksPlugin } from './bricks/bricks';
8 | import { CustomPlugin } from './myplugin';
9 |
10 | const config: ResourceManagerConfig = {
11 |
12 |
13 | buildConfig: (params) => {
14 |
15 | const { target, command, projectName, version } = params;
16 |
17 | if (command == 'build') {
18 | const outputDir = '.';
19 | return {
20 | outputDir,
21 | commands: [
22 | // new EmitResConfigFilePlugin({
23 | // output: "resource/default.res.json",
24 | // typeSelector: config.typeSelector,
25 | // nameSelector: p => path.basename(p).replace(/\./gi, "_"),
26 | // groupSelector: p => "preload"
27 | // }),
28 | new ExmlPlugin('debug'), // 非 EUI 项目关闭此设置
29 | new IncrementCompilePlugin(),
30 | ]
31 | }
32 | }
33 | else if (command == 'publish') {
34 | const outputDir = `bin-release/web/${version}`;
35 | return {
36 | outputDir,
37 | commands: [
38 | new CustomPlugin(),
39 | new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
40 | new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
41 | new UglifyPlugin([{
42 | sources: ["main.js"],
43 | target: "main.min.js"
44 | }]),
45 | new RenamePlugin({
46 | verbose: true, hash: 'crc32', matchers: [
47 | { from: "**/*.js", to: "[path][name]_[hash].[ext]" }
48 | ]
49 | }),
50 | new ManifestPlugin({ output: "manifest.json" })
51 | ]
52 | }
53 | }
54 | else {
55 | throw `unknown command : ${params.command}`
56 | }
57 | },
58 |
59 | mergeSelector: (path) => {
60 | if (path.indexOf("assets/bitmap/") >= 0) {
61 | return "assets/bitmap/sheet.sheet"
62 | }
63 | else if (path.indexOf("armature") >= 0 && path.indexOf(".json") >= 0) {
64 | return "assets/armature/1.zip";
65 | }
66 | },
67 |
68 | typeSelector: (path) => {
69 | const ext = path.substr(path.lastIndexOf(".") + 1);
70 | const typeMap = {
71 | "jpg": "image",
72 | "png": "image",
73 | "webp": "image",
74 | "json": "json",
75 | "fnt": "font",
76 | "pvr": "pvr",
77 | "mp3": "sound",
78 | "zip": "zip",
79 | "sheet": "sheet",
80 | "exml": "text"
81 | }
82 | let type = typeMap[ext];
83 | if (type == "json") {
84 | if (path.indexOf("sheet") >= 0) {
85 | type = "sheet";
86 | } else if (path.indexOf("movieclip") >= 0) {
87 | type = "movieclip";
88 | };
89 | }
90 | return type;
91 | }
92 | }
93 |
94 |
95 | export = config;
96 |
--------------------------------------------------------------------------------
/src/ThemeAdapter.ts:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 |
30 |
31 | class ThemeAdapter implements eui.IThemeAdapter {
32 |
33 | /**
34 | * 解析主题
35 | * @param url 待解析的主题url
36 | * @param onSuccess 解析完成回调函数,示例:compFunc(e:egret.Event):void;
37 | * @param onError 解析失败回调函数,示例:errorFunc():void;
38 | * @param thisObject 回调的this引用
39 | */
40 | public getTheme(url: string, onSuccess: Function, onError: Function, thisObject: any): void {
41 |
42 | function onResGet(e: string): void {
43 | onSuccess.call(thisObject, e);
44 | }
45 | function onResError(e: RES.ResourceEvent): void {
46 | if (e.resItem.url == url) {
47 | RES.removeEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, onResError, null);
48 | onError.call(thisObject);
49 | }
50 | }
51 |
52 | if (typeof generateEUI !== 'undefined') {
53 | egret.callLater(() => {
54 | onSuccess.call(thisObject, generateEUI);
55 | }, this);
56 | }
57 | else if (typeof generateEUI2 !== 'undefined') {
58 | RES.getResByUrl("resource/gameEui.json", (data, url) => {
59 | window["JSONParseClass"]["setData"](data);
60 | egret.callLater(() => {
61 | onSuccess.call(thisObject, generateEUI2);
62 | }, this);
63 | }, this, RES.ResourceItem.TYPE_JSON);
64 | }
65 | else {
66 | RES.addEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, onResError, null);
67 | RES.getResByUrl(url, onResGet, this, RES.ResourceItem.TYPE_TEXT);
68 | }
69 | }
70 | }
71 |
72 | declare var generateEUI: { paths: string[], skins: any }
73 | declare var generateEUI2: { paths: string[], skins: any }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Egret
7 |
8 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
25 |
26 |
36 |
37 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/template/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Egret
7 |
8 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
25 |
26 |
37 |
38 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/bin-release/web/101101/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Egret
7 |
8 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
25 |
26 |
37 |
38 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/bin-debug/ThemeAdapter.js:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 | var __reflect = (this && this.__reflect) || function (p, c, t) {
30 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
31 | };
32 | var ThemeAdapter = (function () {
33 | function ThemeAdapter() {
34 | }
35 | /**
36 | * 解析主题
37 | * @param url 待解析的主题url
38 | * @param onSuccess 解析完成回调函数,示例:compFunc(e:egret.Event):void;
39 | * @param onError 解析失败回调函数,示例:errorFunc():void;
40 | * @param thisObject 回调的this引用
41 | */
42 | ThemeAdapter.prototype.getTheme = function (url, onSuccess, onError, thisObject) {
43 | var _this = this;
44 | function onResGet(e) {
45 | onSuccess.call(thisObject, e);
46 | }
47 | function onResError(e) {
48 | if (e.resItem.url == url) {
49 | RES.removeEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, onResError, null);
50 | onError.call(thisObject);
51 | }
52 | }
53 | if (typeof generateEUI !== 'undefined') {
54 | egret.callLater(function () {
55 | onSuccess.call(thisObject, generateEUI);
56 | }, this);
57 | }
58 | else if (typeof generateEUI2 !== 'undefined') {
59 | RES.getResByUrl("resource/gameEui.json", function (data, url) {
60 | window["JSONParseClass"]["setData"](data);
61 | egret.callLater(function () {
62 | onSuccess.call(thisObject, generateEUI2);
63 | }, _this);
64 | }, this, RES.ResourceItem.TYPE_JSON);
65 | }
66 | else {
67 | RES.addEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, onResError, null);
68 | RES.getResByUrl(url, onResGet, this, RES.ResourceItem.TYPE_TEXT);
69 | }
70 | };
71 | return ThemeAdapter;
72 | }());
73 | __reflect(ThemeAdapter.prototype, "ThemeAdapter", ["eui.IThemeAdapter"]);
74 |
--------------------------------------------------------------------------------
/bin-release/web/180824154858/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Egret
7 |
8 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
25 |
26 |
37 |
38 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/bin-debug/game/layer/GameOverLayer.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**游戏结束 */
12 | var GameOverLayer = (function (_super) {
13 | __extends(GameOverLayer, _super);
14 | function GameOverLayer() {
15 | var _this = _super.call(this) || this;
16 | _this.init();
17 | return _this;
18 | }
19 | GameOverLayer.prototype.init = function () {
20 | //
21 | var bg_wenzi = GameConst.createBitmapFromSheet("bg_wenzi", "ui");
22 | bg_wenzi.x = (GameConst.StageW - bg_wenzi.width) / 2;
23 | this.addChild(bg_wenzi);
24 | //失败
25 | var shibai = GameConst.createBitmapFromSheet("shibai", "ui");
26 | shibai.x = (GameConst.StageW - shibai.width) / 2;
27 | shibai.y = 50;
28 | this.addChild(shibai);
29 | var fenshu = GameConst.createBitmapFromSheet("fenshu", "ui");
30 | this.addChild(fenshu);
31 | fenshu.x = 120;
32 | fenshu.y = 238;
33 | var zuigaojilu = GameConst.createBitmapFromSheet("zuigaojilu", "ui");
34 | zuigaojilu.x = 290;
35 | zuigaojilu.y = 238;
36 | this.addChild(zuigaojilu);
37 | /**再玩一局 */
38 | var btn_y = GameConst.createBitmapFromSheet("btn_y", "ui");
39 | btn_y.anchorOffsetX = btn_y.width / 2;
40 | btn_y.anchorOffsetY = btn_y.height / 2;
41 | btn_y.x = GameConst.StageW / 2;
42 | btn_y.y = GameConst.StageH / 2 - 20;
43 | this.addChild(btn_y);
44 | var btn_zaiwan = GameConst.createBitmapFromSheet("btn_zaiwan", "ui");
45 | btn_zaiwan.x = (GameConst.StageW - btn_zaiwan.width) / 2;
46 | btn_zaiwan.y = GameConst.StageH / 2 - 35;
47 | btn_zaiwan.touchEnabled = true;
48 | this.addChild(btn_zaiwan);
49 | /**炫耀一下 */
50 | var btn_b = GameConst.createBitmapFromSheet("btn_b", "ui");
51 | btn_b.anchorOffsetX = btn_b.width / 2;
52 | btn_b.anchorOffsetY = btn_b.height / 2;
53 | btn_b.x = GameConst.StageW / 2;
54 | btn_b.y = GameConst.StageH / 2 + 145;
55 | this.addChild(btn_b);
56 | var btn_xuanya = GameConst.createBitmapFromSheet("btn_xuanya", "ui");
57 | btn_xuanya.x = (GameConst.StageW - btn_zaiwan.width) / 2;
58 | btn_xuanya.y = GameConst.StageH / 2 + 130;
59 | btn_xuanya.touchEnabled = true;
60 | this.addChild(btn_xuanya);
61 | //分数
62 | this.scoreNum = new SpecialNumber();
63 | this.scoreNum.x = 138;
64 | this.scoreNum.y = 283;
65 | this.addChild(this.scoreNum);
66 | //最高分数
67 | this.maxScore = new SpecialNumber();
68 | this.maxScore.x = 330;
69 | this.maxScore.y = 283;
70 | this.addChild(this.maxScore);
71 | btn_zaiwan.addEventListener(egret.TouchEvent.TOUCH_TAP, function (e) {
72 | //再来一局
73 | GameControl.Instance.onGameScenesHandler();
74 | }, this);
75 | btn_xuanya.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
76 | //分享
77 | platform.ShareMessage();
78 | }, this);
79 | };
80 | /**游戏结束页面分数最高分数 */
81 | GameOverLayer.prototype.setGameOverDataHandler = function (score, maxScore) {
82 | if (score === void 0) { score = 0; }
83 | if (maxScore === void 0) { maxScore = 0; }
84 | this.scoreNum.setData(score.toString());
85 | this.maxScore.setData(maxScore.toString());
86 | };
87 | return GameOverLayer;
88 | }(egret.Sprite));
89 | __reflect(GameOverLayer.prototype, "GameOverLayer");
90 |
--------------------------------------------------------------------------------
/bin-debug/game/comment/Role.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __extends = this && this.__extends || function __extends(t, e) {
5 | function r() {
6 | this.constructor = t;
7 | }
8 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
9 | r.prototype = e.prototype, t.prototype = new r();
10 | };
11 | /**角色动作类 */
12 | var Role = (function (_super) {
13 | __extends(Role, _super);
14 | function Role() {
15 | var _this = _super.call(this) || this;
16 | _this.currFramesIndex = 0;
17 | _this.Body = new egret.Bitmap;
18 | //人物初始状态
19 | _this.Body = GameConst.createBitmapFromSheet("Role.FRAMES[0][0]", "Sprites");
20 | //设置锚点
21 | _this.Body.anchorOffsetX = _this.Body.width * 0.5;
22 | _this.addChild(_this.Body);
23 | return _this;
24 | }
25 | /**设置状态 */
26 | Role.prototype.setState = function (state) {
27 | this.state = state;
28 | //死亡状态
29 | if (this.state == Role.STATE5) {
30 | this.isLoop = false;
31 | this.Body.anchorOffsetY = this.Body.height * 0;
32 | }
33 | else {
34 | this.isLoop = true;
35 | this.Body.anchorOffsetY = this.Body.height * 1;
36 | }
37 | if (this.state == Role.STATE3 || this.state == Role.STATE4) {
38 | this.currFrames = [];
39 | if (Math.random() > 0.5) {
40 | this.currFrames.push(Role.FRAMES[this.state][0]);
41 | }
42 | else {
43 | this.currFrames.push(Role.FRAMES[this.state][1]);
44 | }
45 | }
46 | else {
47 | this.currFrames = Role.FRAMES[this.state];
48 | }
49 | this.currFramesIndex = 0;
50 | this.setBody();
51 | };
52 | Role.prototype.setBody = function () {
53 | this.Body.texture = GameConst.getTextureFromSheet(this.currFrames[this.currFramesIndex], "Sprites");
54 | this.Body.anchorOffsetX = this.Body.width * 0.5;
55 | if (this.state == Role.STATE5) {
56 | this.isLoop = false;
57 | this.Body.anchorOffsetY = this.Body.height * 0;
58 | }
59 | else {
60 | this.isLoop = true;
61 | this.Body.anchorOffsetY = this.Body.height * 1;
62 | }
63 | };
64 | Role.prototype.run = function () {
65 | this.runFlag++;
66 | if (this.runFlag > 4) {
67 | this.runFlag = 0;
68 | }
69 | if (this.runFlag != 0) {
70 | return;
71 | }
72 | var gotoFrameIndex = this.currFramesIndex + 1;
73 | if (gotoFrameIndex == this.currFrames.length) {
74 | if (this.isLoop) {
75 | gotoFrameIndex = 0;
76 | }
77 | else {
78 | gotoFrameIndex = this.currFramesIndex;
79 | }
80 | }
81 | if (gotoFrameIndex != this.currFramesIndex) {
82 | this.currFramesIndex = gotoFrameIndex;
83 | this.setBody();
84 | }
85 | return false;
86 | };
87 | Role.prototype.play = function () {
88 | egret.startTick(this.run, this);
89 | this.runFlag = 0;
90 | };
91 | Role.prototype.stop = function () {
92 | egret.stopTick(this.run, this);
93 | };
94 | //状态
95 | Role.STATE1 = 0;
96 | Role.STATE2 = 1;
97 | Role.STATE3 = 2;
98 | Role.STATE4 = 3;
99 | Role.STATE5 = 4;
100 | /**人物状态集合 */
101 | Role.FRAMES = [
102 | ["0020003", "0020004", "0020005", "0020006", "0020007"],
103 | ["0020008"],
104 | ["0020009", "0020010"],
105 | ["0020011", "0020012"],
106 | ["xue0001", "xue0002", "xue0003", "xue0004", "xue0005"]
107 | ];
108 | return Role;
109 | }(egret.Sprite));
110 | __reflect(Role.prototype, "Role");
111 |
--------------------------------------------------------------------------------
/scripts/wxgame/wxgame.ts:
--------------------------------------------------------------------------------
1 | import * as fs from 'fs';
2 | import * as path from 'path';
3 | export class WxgamePlugin implements plugins.Command {
4 |
5 | constructor() {
6 | }
7 | async onFile(file: plugins.File) {
8 | if (file.extname == '.js') {
9 | const filename = file.origin;
10 | if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
11 | return null;
12 | }
13 | if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
14 | let content = file.contents.toString();
15 | content += `;window.egret = egret;`;
16 | content = content.replace(/definition = __global/, "definition = window");
17 | file.contents = new Buffer(content);
18 | }
19 | else {
20 | let content = file.contents.toString();
21 | if (
22 | filename == "libs/modules/res/res.js" ||
23 | filename == 'libs/modules/res/res.min.js' ||
24 | filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
25 | filename == 'libs/modules/assetsmanager/assetsmanager.js'
26 | ) {
27 | content += ";window.RES = RES;"
28 | }
29 | if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
30 | content += ";window.eui = eui;"
31 | }
32 | if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
33 | content += ';window.dragonBones = dragonBones';
34 | }
35 | content = "var egret = window.egret;" + content;
36 | if (filename == 'main.js') {
37 | content += ";window.Main = Main;"
38 | }
39 | file.contents = new Buffer(content);
40 | }
41 | }
42 | return file;
43 | }
44 | async onFinish(pluginContext: plugins.CommandContext) {
45 | //同步 index.html 配置到 game.js
46 | const gameJSPath = path.join(pluginContext.outputDir, "game.js");
47 | let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
48 | const projectConfig = pluginContext.buildConfig.projectConfig;
49 | const optionStr =
50 | `entryClassName: ${projectConfig.entryClassName},\n\t\t` +
51 | `orientation: ${projectConfig.orientation},\n\t\t` +
52 | `frameRate: ${projectConfig.frameRate},\n\t\t` +
53 | `scaleMode: ${projectConfig.scaleMode},\n\t\t` +
54 | `contentWidth: ${projectConfig.contentWidth},\n\t\t` +
55 | `contentHeight: ${projectConfig.contentHeight},\n\t\t` +
56 | `showFPS: ${projectConfig.showFPS},\n\t\t` +
57 | `fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
58 | `showLog: ${projectConfig.showLog},\n\t\t` +
59 | `maxTouches: ${projectConfig.maxTouches},`;
60 | const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
61 | const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
62 | gameJSContent = gameJSContent.replace(reg, replaceStr);
63 | fs.writeFileSync(gameJSPath, gameJSContent);
64 |
65 | //修改横竖屏
66 | let orientation;
67 | if (projectConfig.orientation == '"landscape"') {
68 | orientation = "landscape";
69 | }
70 | else {
71 | orientation = "portrait";
72 | }
73 | const gameJSONPath = path.join(pluginContext.outputDir, "game.json");
74 | let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
75 | gameJSONContent.deviceOrientation = orientation;
76 | fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
77 | }
78 | }
--------------------------------------------------------------------------------
/bin-debug/Platform.js:
--------------------------------------------------------------------------------
1 | var __reflect = (this && this.__reflect) || function (p, c, t) {
2 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
3 | };
4 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5 | return new (P || (P = Promise))(function (resolve, reject) {
6 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
9 | step((generator = generator.apply(thisArg, _arguments || [])).next());
10 | });
11 | };
12 | var __generator = (this && this.__generator) || function (thisArg, body) {
13 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
14 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15 | function verb(n) { return function (v) { return step([n, v]); }; }
16 | function step(op) {
17 | if (f) throw new TypeError("Generator is already executing.");
18 | while (_) try {
19 | if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
20 | if (y = 0, t) op = [0, t.value];
21 | switch (op[0]) {
22 | case 0: case 1: t = op; break;
23 | case 4: _.label++; return { value: op[1], done: false };
24 | case 5: _.label++; y = op[1]; op = [0]; continue;
25 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
26 | default:
27 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31 | if (t[2]) _.ops.pop();
32 | _.trys.pop(); continue;
33 | }
34 | op = body.call(thisArg, _);
35 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37 | }
38 | };
39 | var DebugPlatform = (function () {
40 | function DebugPlatform() {
41 | }
42 | DebugPlatform.prototype.getUserInfo = function () {
43 | return __awaiter(this, void 0, void 0, function () {
44 | return __generator(this, function (_a) {
45 | return [2 /*return*/, { nickName: "username" }];
46 | });
47 | });
48 | };
49 | DebugPlatform.prototype.login = function () {
50 | return __awaiter(this, void 0, void 0, function () {
51 | return __generator(this, function (_a) {
52 | return [2 /*return*/];
53 | });
54 | });
55 | };
56 | DebugPlatform.prototype.ShowshareMenu = function () {
57 | return __awaiter(this, void 0, void 0, function () {
58 | return __generator(this, function (_a) {
59 | return [2 /*return*/];
60 | });
61 | });
62 | };
63 | DebugPlatform.prototype.ShareMessage = function () {
64 | return __awaiter(this, void 0, void 0, function () {
65 | return __generator(this, function (_a) {
66 | return [2 /*return*/];
67 | });
68 | });
69 | };
70 | DebugPlatform.prototype.GetInfo = function () {
71 | return __awaiter(this, void 0, void 0, function () {
72 | return __generator(this, function (_a) {
73 | return [2 /*return*/];
74 | });
75 | });
76 | };
77 | return DebugPlatform;
78 | }());
79 | __reflect(DebugPlatform.prototype, "DebugPlatform", ["Platform"]);
80 | if (!window.platform) {
81 | window.platform = new DebugPlatform();
82 | }
83 |
--------------------------------------------------------------------------------
/src/Main.ts:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 |
30 | class Main extends eui.UILayer {
31 |
32 |
33 | protected createChildren(): void {
34 | super.createChildren();
35 | GameConst.StageW = this.stage.stageWidth;
36 | GameConst.StageH = this.stage.stageHeight;
37 | egret.lifecycle.addLifecycleListener((context) => {
38 | // custom lifecycle plugin
39 | })
40 | egret.lifecycle.onPause = () => {
41 | egret.ticker.pause();
42 | }
43 | egret.lifecycle.onResume = () => {
44 | egret.ticker.resume();
45 | }
46 | //注入自定义的素材解析器
47 | let assetAdapter = new AssetAdapter();
48 | egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
49 | egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
50 | this.runGame().catch(e => {
51 | console.log(e);
52 | })
53 | }
54 |
55 | private async runGame() {
56 | await this.loadResource()
57 | this.createGameScene();
58 | const result = await RES.getResAsync("description_json")
59 | await platform.login();
60 | const userInfo = await platform.getUserInfo();
61 | console.log(userInfo);
62 | await platform.ShowshareMenu();
63 |
64 |
65 |
66 | }
67 |
68 | private async loadResource() {
69 | try {
70 | const loadingView = new LoadingUI();
71 | this.stage.addChild(loadingView);
72 | await RES.loadConfig("resource/default.res.json", "resource/");
73 | await this.loadTheme();
74 | await RES.loadGroup("preload", 0, loadingView);
75 | this.stage.removeChild(loadingView);
76 | }
77 | catch (e) {
78 | console.error(e);
79 | }
80 | }
81 |
82 | private loadTheme() {
83 | return new Promise((resolve, reject) => {
84 | // load skin theme configuration file, you can manually modify the file. And replace the default skin.
85 | //加载皮肤主题配置文件,可以手动修改这个文件。替换默认皮肤。
86 | let theme = new eui.Theme("resource/default.thm.json", this.stage);
87 | theme.addEventListener(eui.UIEvent.COMPLETE, () => {
88 | resolve();
89 | }, this);
90 |
91 | })
92 | }
93 | /**
94 | * 创建场景界面
95 | * Create scene interface
96 | */
97 | protected createGameScene(): void {
98 | this.addChild(new GameApp());
99 | }
100 | }
--------------------------------------------------------------------------------
/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Basic Options */
4 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
5 | "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
6 | "lib": [
7 | "es5",
8 | "es2015.promise"
9 | ], /* Specify library files to be included in the compilation: */
10 | "allowJs": true, /* Allow javascript files to be compiled. */
11 | // "checkJs": true, /* Report errors in .js files. */
12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
14 | // "sourceMap": true, /* Generates corresponding '.map' file. */
15 | // "outFile": "./", /* Concatenate and emit output to single file. */
16 | // "outDir": "./", /* Redirect output structure to the directory. */
17 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
18 | // "removeComments": true, /* Do not emit comments to output. */
19 | // "noEmit": true, /* Do not emit outputs. */
20 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
21 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
22 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
23 | /* Strict Type-Checking Options */
24 | "strict": true, /* Enable all strict type-checking options. */
25 | "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */
26 | // "strictNullChecks": true, /* Enable strict null checks. */
27 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
28 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
29 | /* Additional Checks */
30 | // "noUnusedLocals": true, /* Report errors on unused locals. */
31 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
32 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
33 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
34 | /* Module Resolution Options */
35 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
36 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
37 | /* List of root folders whose combined content represents the structure of the project at runtime. */
38 | // "typeRoots": [], /* List of folders to include type definitions from. */
39 | // "types": [], /* Type declaration files to be included in compilation. */
40 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
41 | /* Source Map Options */
42 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
43 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
44 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
45 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
46 | /* Experimental Options */
47 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
48 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
49 | }
50 | }
--------------------------------------------------------------------------------
/libs/modules/promise/promise.min.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;G>t;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[ee]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return w(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return ie.error=e,ie}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?w(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===re?S(t,e._result):e._state===oe?j(t,e._result):E(e,void 0,function(e){return w(t,e)},function(e){return j(t,e)})}function g(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===ie?j(t,ie.error):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function w(e,n){e===n?j(e,v()):t(n)?g(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),P(t)}function S(t,e){t._state===ne&&(t._result=e,t._state=re,0!==t._subscribers.length&&J(P,t))}function j(t,e){t._state===ne&&(t._state=oe,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+re]=n,o[i+oe]=r,0===i&&t._state&&J(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;si;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[ee]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if("undefined"!=typeof egret_native&&egret_native.capability&&!egret_native.capability("Promise")&&(n=void 0),n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):te())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),te=void 0;te=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var ee=Math.random().toString(36).substring(16),ne=void 0,re=1,oe=2,ie=new T,se=new T,ue=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===ne&&t>n;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==ne)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);g(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===ne&&(this._remaining--,t===oe?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(re,e,t)},function(t){return n._settledAt(oe,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U}),ES6Promise.polyfill();
--------------------------------------------------------------------------------
/bin-release/web/101101/js/promise.min_83a6a5d.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;G>t;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[ee]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return w(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return ie.error=e,ie}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?w(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===re?S(t,e._result):e._state===oe?j(t,e._result):E(e,void 0,function(e){return w(t,e)},function(e){return j(t,e)})}function g(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===ie?j(t,ie.error):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function w(e,n){e===n?j(e,v()):t(n)?g(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),P(t)}function S(t,e){t._state===ne&&(t._result=e,t._state=re,0!==t._subscribers.length&&J(P,t))}function j(t,e){t._state===ne&&(t._state=oe,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+re]=n,o[i+oe]=r,0===i&&t._state&&J(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;si;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[ee]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if("undefined"!=typeof egret_native&&egret_native.capability&&!egret_native.capability("Promise")&&(n=void 0),n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):te())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),te=void 0;te=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var ee=Math.random().toString(36).substring(16),ne=void 0,re=1,oe=2,ie=new T,se=new T,ue=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===ne&&t>n;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==ne)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);g(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===ne&&(this._remaining--,t===oe?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(re,e,t)},function(t){return n._settledAt(oe,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U}),ES6Promise.polyfill();
--------------------------------------------------------------------------------
/bin-release/web/180824154858/js/promise.min_83a6a5d.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;G>t;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[ee]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return w(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return ie.error=e,ie}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?w(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===re?S(t,e._result):e._state===oe?j(t,e._result):E(e,void 0,function(e){return w(t,e)},function(e){return j(t,e)})}function g(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===ie?j(t,ie.error):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function w(e,n){e===n?j(e,v()):t(n)?g(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),P(t)}function S(t,e){t._state===ne&&(t._result=e,t._state=re,0!==t._subscribers.length&&J(P,t))}function j(t,e){t._state===ne&&(t._state=oe,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+re]=n,o[i+oe]=r,0===i&&t._state&&J(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;si;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[ee]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if("undefined"!=typeof egret_native&&egret_native.capability&&!egret_native.capability("Promise")&&(n=void 0),n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):te())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),te=void 0;te=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var ee=Math.random().toString(36).substring(16),ne=void 0,re=1,oe=2,ie=new T,se=new T,ue=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===ne&&t>n;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==ne)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);g(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===ne&&(this._remaining--,t===oe?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(re,e,t)},function(t){return n._settledAt(oe,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U}),ES6Promise.polyfill();
--------------------------------------------------------------------------------
/bin-debug/Main.js:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2014-present, Egret Technology.
4 | // All rights reserved.
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of the Egret nor the
14 | // names of its contributors may be used to endorse or promote products
15 | // derived from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | //////////////////////////////////////////////////////////////////////////////////////
29 | var __reflect = (this && this.__reflect) || function (p, c, t) {
30 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
31 | };
32 | var __extends = this && this.__extends || function __extends(t, e) {
33 | function r() {
34 | this.constructor = t;
35 | }
36 | for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
37 | r.prototype = e.prototype, t.prototype = new r();
38 | };
39 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40 | return new (P || (P = Promise))(function (resolve, reject) {
41 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
44 | step((generator = generator.apply(thisArg, _arguments || [])).next());
45 | });
46 | };
47 | var __generator = (this && this.__generator) || function (thisArg, body) {
48 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
49 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
50 | function verb(n) { return function (v) { return step([n, v]); }; }
51 | function step(op) {
52 | if (f) throw new TypeError("Generator is already executing.");
53 | while (_) try {
54 | if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
55 | if (y = 0, t) op = [0, t.value];
56 | switch (op[0]) {
57 | case 0: case 1: t = op; break;
58 | case 4: _.label++; return { value: op[1], done: false };
59 | case 5: _.label++; y = op[1]; op = [0]; continue;
60 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
61 | default:
62 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
63 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
64 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
65 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
66 | if (t[2]) _.ops.pop();
67 | _.trys.pop(); continue;
68 | }
69 | op = body.call(thisArg, _);
70 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
71 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
72 | }
73 | };
74 | var Main = (function (_super) {
75 | __extends(Main, _super);
76 | function Main() {
77 | return _super !== null && _super.apply(this, arguments) || this;
78 | }
79 | Main.prototype.createChildren = function () {
80 | _super.prototype.createChildren.call(this);
81 | GameConst.StageW = this.stage.stageWidth;
82 | GameConst.StageH = this.stage.stageHeight;
83 | egret.lifecycle.addLifecycleListener(function (context) {
84 | // custom lifecycle plugin
85 | });
86 | egret.lifecycle.onPause = function () {
87 | egret.ticker.pause();
88 | };
89 | egret.lifecycle.onResume = function () {
90 | egret.ticker.resume();
91 | };
92 | //注入自定义的素材解析器
93 | var assetAdapter = new AssetAdapter();
94 | egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
95 | egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
96 | this.runGame().catch(function (e) {
97 | console.log(e);
98 | });
99 | };
100 | Main.prototype.runGame = function () {
101 | return __awaiter(this, void 0, void 0, function () {
102 | var result, userInfo;
103 | return __generator(this, function (_a) {
104 | switch (_a.label) {
105 | case 0: return [4 /*yield*/, this.loadResource()];
106 | case 1:
107 | _a.sent();
108 | this.createGameScene();
109 | return [4 /*yield*/, RES.getResAsync("description_json")];
110 | case 2:
111 | result = _a.sent();
112 | return [4 /*yield*/, platform.login()];
113 | case 3:
114 | _a.sent();
115 | return [4 /*yield*/, platform.getUserInfo()];
116 | case 4:
117 | userInfo = _a.sent();
118 | console.log(userInfo);
119 | return [4 /*yield*/, platform.ShowshareMenu()];
120 | case 5:
121 | _a.sent();
122 | return [2 /*return*/];
123 | }
124 | });
125 | });
126 | };
127 | Main.prototype.loadResource = function () {
128 | return __awaiter(this, void 0, void 0, function () {
129 | var loadingView, e_1;
130 | return __generator(this, function (_a) {
131 | switch (_a.label) {
132 | case 0:
133 | _a.trys.push([0, 4, , 5]);
134 | loadingView = new LoadingUI();
135 | this.stage.addChild(loadingView);
136 | return [4 /*yield*/, RES.loadConfig("resource/default.res.json", "resource/")];
137 | case 1:
138 | _a.sent();
139 | return [4 /*yield*/, this.loadTheme()];
140 | case 2:
141 | _a.sent();
142 | return [4 /*yield*/, RES.loadGroup("preload", 0, loadingView)];
143 | case 3:
144 | _a.sent();
145 | this.stage.removeChild(loadingView);
146 | return [3 /*break*/, 5];
147 | case 4:
148 | e_1 = _a.sent();
149 | console.error(e_1);
150 | return [3 /*break*/, 5];
151 | case 5: return [2 /*return*/];
152 | }
153 | });
154 | });
155 | };
156 | Main.prototype.loadTheme = function () {
157 | var _this = this;
158 | return new Promise(function (resolve, reject) {
159 | // load skin theme configuration file, you can manually modify the file. And replace the default skin.
160 | //加载皮肤主题配置文件,可以手动修改这个文件。替换默认皮肤。
161 | var theme = new eui.Theme("resource/default.thm.json", _this.stage);
162 | theme.addEventListener(eui.UIEvent.COMPLETE, function () {
163 | resolve();
164 | }, _this);
165 | });
166 | };
167 | /**
168 | * 创建场景界面
169 | * Create scene interface
170 | */
171 | Main.prototype.createGameScene = function () {
172 | this.addChild(new GameApp());
173 | };
174 | return Main;
175 | }(eui.UILayer));
176 | __reflect(Main.prototype, "Main");
177 |
--------------------------------------------------------------------------------
/scripts/api.d.ts:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * ResourceManager 配置文件
4 | */
5 | type ResourceManagerConfig = {
6 | /**
7 | * 构建与发布配置
8 | */
9 | buildConfig: (param: BuildConfigParam) => UserConfig,
10 | /**
11 | * 设置资源类型
12 | */
13 | typeSelector: (path: string) => (string | null | undefined)
14 | /**
15 | * 设置资源的合并策略
16 | */
17 | mergeSelector?: (path: string) => (string | null | undefined),
18 | /**
19 | * 设置资源的命名策略
20 | * beta 功能,请勿随意使用
21 | */
22 | nameSelector?: (path: string) => (string | null | undefined)
23 | }
24 | /**
25 | * 构建配置
26 | */
27 | type UserConfig = {
28 | /**
29 | * 输出路径
30 | */
31 | outputDir: string,
32 | /**
33 | * 插件
34 | */
35 | commands: (string | plugins.Command)[]
36 | }
37 |
38 | type BuildConfigParam = {
39 |
40 |
41 | /**
42 | * 当前命令,build 或者 command
43 | */
44 | readonly command: string;
45 |
46 | /**
47 | * 发布平台
48 | */
49 | readonly target: string;
50 |
51 | /**
52 | * 开发者指定的版本号
53 | */
54 | readonly version: string;
55 |
56 | /**
57 | * 项目名称
58 | */
59 | readonly projectName: string;
60 |
61 | /**
62 | * 项目路径
63 | */
64 | readonly projectRoot: string;
65 |
66 | /**
67 | * 项目配置
68 | */
69 | readonly projectConfig: ProjectConfig;
70 | }
71 |
72 | type ProjectConfig = {
73 | entryClassName: string;
74 | orientation: string;
75 | frameRate: number;
76 | scaleMode: string;
77 | contentWidth: number;
78 | contentHeight: number;
79 | showFPS: boolean;
80 | fpsStyles: string;
81 | showLog: boolean;
82 | maxTouches: number;
83 | }
84 | /**
85 | * 匹配机制,将满足 from 的文件输出为 to 格式的文件
86 | * from 采用 glob 表达式 , to 包含 [path][name][hash][ext]四个变量
87 | * 示例:{ from:"resource/**.*" , to:"[path][name]_[hash].[ext]" }
88 | */
89 | type Matcher = {
90 |
91 | from: string,
92 |
93 | to: string
94 |
95 | }
96 |
97 |
98 | declare namespace plugins {
99 |
100 | interface CommandContext {
101 |
102 | /**
103 | * 可以用此接口进行文件创建
104 | */
105 | createFile(relativeFilePath: string, contents: Buffer);
106 |
107 | /**
108 | * 构建配置
109 | */
110 | buildConfig: BuildConfigParam;
111 |
112 | /**
113 | * 项目绝对路径
114 | */
115 | projectRoot: string;
116 |
117 | /**
118 | * 项目输出绝对路径
119 | */
120 | outputDir: string;
121 |
122 | }
123 |
124 | /**
125 | * 构建管线命令
126 | */
127 | interface Command {
128 |
129 | /**
130 | * 项目中的每个文件都会执行此函数,返回 file 表示保留此文件,返回 null 表示将此文件从构建管线中删除,即不会发布
131 | */
132 | onFile?(file: File): Promise
133 |
134 | /**
135 | * 项目中所有文件均执行完后,最终会执行此函数。
136 | * 这个函数主要被用于创建新文件
137 | */
138 | onFinish?(pluginContext?: CommandContext): Promise
139 |
140 | [options: string]: any;
141 | }
142 |
143 | interface File {
144 |
145 | /**
146 | * 文件内容的二进制流,如果开发者需要修改文件内容,请修改此属性
147 | */
148 | contents: Buffer;
149 |
150 |
151 | /**
152 | * 文件绝对路径,如果开发者需要对文件进行重命名,请修改此属性
153 | */
154 | path: string;
155 |
156 | /**
157 | * 文件所在的项目的项目路径
158 | */
159 | readonly base: string;
160 |
161 | /**
162 | * 文件的相对于 base 属性的相对路径
163 | */
164 | readonly relative: string;
165 |
166 |
167 | /**
168 | * 文件变更历史,history[0] 即 origin 属性
169 | */
170 | readonly history: ReadonlyArray;
171 |
172 |
173 | /**
174 | * 文件所在的文件夹的绝对路径
175 | */
176 | readonly dirname: string;
177 |
178 | /**
179 | * 文件的文件名
180 | */
181 | readonly basename: string;
182 |
183 |
184 | /**
185 | * 文件的扩展名
186 | */
187 | readonly extname: string;
188 |
189 | /**
190 | * 文件的初始文件名
191 | */
192 | readonly origin: string;
193 |
194 | /**
195 | * 其他自定义属性
196 | */
197 | [customProperty: string]: any;
198 |
199 | }
200 |
201 | }
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 | declare module 'built-in' {
213 |
214 | /**
215 | * 混淆插件参数,设置源代码和目标代码
216 | */
217 | type UglifyPluginOption = { sources: string[], target: string };
218 |
219 | type UglifyPluginOptions = UglifyPluginOption[];
220 |
221 | /**
222 | * 混淆插件
223 | */
224 | export class UglifyPlugin implements plugins.Command {
225 |
226 | constructor(mergeSelector: UglifyPluginOptions);
227 |
228 | }
229 |
230 |
231 | type LibraryType = "debug" | "release";
232 |
233 | type CompilePluginOptions = { libraryType: LibraryType, defines?: any };
234 | /**
235 | * 编译命令
236 | */
237 | export class CompilePlugin implements plugins.Command {
238 |
239 | constructor(options: CompilePluginOptions);
240 | }
241 |
242 | /**
243 | * EXML 插件,用于发布 EXML 文件
244 | */
245 | export class ExmlPlugin implements plugins.Command {
246 |
247 | constructor(publishPolicy: EXML_Publish_Policy);
248 |
249 | }
250 |
251 | /**
252 | * 发布策略
253 | * * default : 使用 egretProperties.json 中的 exmlPublishPolicy 中的策略
254 | * * debug : 默认策略,用于开发环境
255 | * * contents : 将 EXML 的内容写入到主题文件中
256 | * * gjs : 将生成的JS文件写入到主题文件中
257 | * * commonjs : 将EXML合并为一个 CommonJS 风格的文件
258 | * * commonjs2 : 将EXML合并为一个含有解析方法和皮肤定义的文件,且皮肤抽离为一份配置
259 | */
260 | type EXML_Publish_Policy = "default" | "debug" | "contents" | "gjs" | "commonjs" | "commonjs2"
261 |
262 |
263 |
264 |
265 | /**
266 | * 生成 manifest 文件,这个文件会被用于记录 JavaScript 文件的版本号
267 | */
268 | export class ManifestPlugin implements plugins.Command {
269 | constructor(options?: ManifestPluginOptions)
270 | }
271 |
272 | /**
273 | * 生成文件的文件名
274 | * 支持 json 与 js 两种格式
275 | */
276 | type ManifestPluginOptions = {
277 |
278 | output: string,
279 |
280 | hash?: "crc32",
281 |
282 | /**
283 | * 是否输出转换过程
284 | */
285 | verbose?: boolean
286 |
287 |
288 | }
289 |
290 | /**
291 | * EmitResConfigFilePlugin 的参数
292 | * * output: 生成路径,可以指定生成为 *.res.js 文件或者 *.res.json 文件
293 | * * typeSelector: 根据文件路径决定文件类型
294 | * * nameSelector: 根据文件路径决定文件的资源名
295 | * * groupSelector: 根据文件路径决定资源所述的资源组
296 | */
297 | type EmitResConfigFilePluginOptions = {
298 | output: string,
299 | typeSelector: (path: string) => string | null | undefined,
300 | nameSelector: (path: string) => string | null | undefined,
301 | groupSelector: (path: string) => string | null | undefined,
302 | }
303 |
304 |
305 | /**
306 | * 生成 res.json 文件或者 res.js 文件
307 | */
308 | export class EmitResConfigFilePlugin implements plugins.Command {
309 |
310 | constructor(options: EmitResConfigFilePluginOptions)
311 |
312 | }
313 |
314 | export type ConvertResourceConfigPluginOption = {
315 |
316 | resourceConfigFiles: { filename: string, root: string }[];
317 |
318 | nameSelector: (url: string) => string
319 |
320 |
321 | }
322 |
323 | export class ConvertResConfigFilePlugin implements plugins.Command {
324 |
325 | constructor(options: ConvertResourceConfigPluginOption);
326 | }
327 |
328 |
329 | /**
330 | * 增量编译
331 | * 这个插件生成的 JavaScript 代码不会被添加到构建管线中,后续其他插件无法获取生成的 js 文件
332 | * 这个功能将会在未来被 watch 模式代替掉
333 | */
334 | export class IncrementCompilePlugin implements plugins.Command {
335 |
336 | }
337 |
338 | /**
339 | * 使用 TextureMerger 实现纹理自动合并,依赖 TextureMerger 1.7 以上的版本
340 | */
341 | export class TextureMergerPlugin implements plugins.Command {
342 |
343 | constructor();
344 |
345 | }
346 |
347 | type CleanPluginOptions = {
348 |
349 | matchers: string[]
350 | }
351 |
352 |
353 | export class CleanPlugin implements plugins.Command {
354 | constructor(options: CleanPluginOptions);
355 | }
356 |
357 |
358 | type RenamePluginOptions = {
359 |
360 | /**
361 | * 是否输出日志
362 | */
363 | verbose?: boolean
364 |
365 | /**
366 | * 采用何种 hash 算法,目前暂时只支持 crc32
367 | */
368 | hash?: "crc32"
369 |
370 |
371 | /**
372 | * 设置匹配规则,将指定文件进行改名
373 | * 该参数是个数组,允许设置多个匹配规则
374 | */
375 | matchers: Matcher[]
376 | }
377 |
378 |
379 | /**
380 | * 修改文件名插件
381 | */
382 | export class RenamePlugin implements plugins.Command {
383 | constructor(options: RenamePluginOptions);
384 | }
385 |
386 | type ResSplitPluginOptions = {
387 |
388 | /**
389 | * 是否输出日志
390 | */
391 | verbose?: boolean
392 |
393 | /**
394 | * 设置匹配规则,将指定文件拷贝至其他文件夹
395 | * 该参数是个数组,允许设置多个匹配规则
396 | */
397 | matchers: Matcher[]
398 | }
399 |
400 | export class ResSplitPlugin implements plugins.Command {
401 | constructor(options: ResSplitPluginOptions);
402 | }
403 |
404 |
405 | type ZipPluginOptions = {
406 |
407 | mergeSelector: (p: string) => string
408 | }
409 |
410 | export class ZipPlugin implements plugins.Command {
411 |
412 | constructor(option: ZipPluginOptions);
413 | }
414 |
415 | }
--------------------------------------------------------------------------------
/libs/modules/tween/tween.min.js:
--------------------------------------------------------------------------------
1 | var __reflect=this&&this.__reflect||function(t,e,n){t.__class__=e,n?n.push(e):n=[e],t.__types__=t.__types__?n.concat(t.__types__):n},__extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n},egret;!function(t){var e=function(){function e(){t.$error(1014)}return e.get=function(t){return-1>t&&(t=-1),t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},e.getPowIn=function(t){return function(e){return Math.pow(e,t)}},e.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},e.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},e.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},e.sineOut=function(t){return Math.sin(t*Math.PI/2)},e.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},e.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},e.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},e.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},e.circOut=function(t){return Math.sqrt(1- --t*t)},e.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},e.bounceIn=function(t){return 1-e.bounceOut(1-t)},e.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},e.bounceInOut=function(t){return.5>t?.5*e.bounceIn(2*t):.5*e.bounceOut(2*t-1)+.5},e.getElasticIn=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return-(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e))}},e.getElasticOut=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*n/e)+1}},e.getElasticInOut=function(t,e){var n=2*Math.PI;return function(i){var s=e/n*Math.asin(1/t);return(i*=2)<1?-.5*(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e)):t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*n/e)*.5+1}},e.quadIn=e.getPowIn(2),e.quadOut=e.getPowOut(2),e.quadInOut=e.getPowInOut(2),e.cubicIn=e.getPowIn(3),e.cubicOut=e.getPowOut(3),e.cubicInOut=e.getPowInOut(3),e.quartIn=e.getPowIn(4),e.quartOut=e.getPowOut(4),e.quartInOut=e.getPowInOut(4),e.quintIn=e.getPowIn(5),e.quintOut=e.getPowOut(5),e.quintInOut=e.getPowInOut(5),e.backIn=e.getBackIn(1.7),e.backOut=e.getBackOut(1.7),e.backInOut=e.getBackInOut(1.7),e.elasticIn=e.getElasticIn(1,.3),e.elasticOut=e.getElasticOut(1,.3),e.elasticInOut=e.getElasticInOut(1,.3*1.5),e}();t.Ease=e,__reflect(e.prototype,"egret.Ease")}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,i){var s=e.call(this)||this;return s._target=null,s._useTicks=!1,s.ignoreGlobalPause=!1,s.loop=!1,s.pluginData=null,s._steps=null,s.paused=!1,s.duration=0,s._prevPos=-1,s.position=null,s._prevPosition=0,s._stepPosition=0,s.passive=!1,s.initialize(t,n,i),s}return __extends(n,e),n.get=function(t,e,i,s){return void 0===i&&(i=null),void 0===s&&(s=!1),s&&n.removeTweens(t),new n(t,e,i)},n.removeTweens=function(t){if(t.tween_count){for(var e=n._tweens,i=e.length-1;i>=0;i--)e[i]._target==t&&(e[i].paused=!0,e.splice(i,1));t.tween_count=0}},n.pauseTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!0)},n.resumeTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!1)},n.tick=function(t,e){void 0===e&&(e=!1);var i=t-n._lastTime;n._lastTime=t;for(var s=n._tweens.concat(),r=s.length-1;r>=0;r--){var o=s[r];e&&!o.ignoreGlobalPause||o.paused||o.$tick(o._useTicks?1:i)}return!1},n._register=function(e,i){var s=e._target,r=n._tweens;if(i)s&&(s.tween_count=s.tween_count>0?s.tween_count+1:1),r.push(e),n._inited||(n._lastTime=t.getTimer(),t.ticker.$startTick(n.tick,null),n._inited=!0);else{s&&s.tween_count--;for(var o=r.length;o--;)if(r[o]==e)return void r.splice(o,1)}},n.removeAllTweens=function(){for(var t=n._tweens,e=0,i=t.length;i>e;e++){var s=t[e];s.paused=!0,s._target.tween_count=0}t.length=0},n.prototype.initialize=function(t,e,i){this._target=t,e&&(this._useTicks=e.useTicks,this.ignoreGlobalPause=e.ignoreGlobalPause,this.loop=e.loop,e.onChange&&this.addEventListener("change",e.onChange,e.onChangeObj),e.override&&n.removeTweens(t)),this.pluginData=i||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],e&&e.paused?this.paused=!0:n._register(this,!0),e&&null!=e.position&&this.setPosition(e.position,n.NONE)},n.prototype.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var n=t,i=!1;if(n>=this.duration)if(this.loop){var s=n%this.duration;n=n>0&&0===s?this.duration:s}else n=this.duration,i=!0;if(n==this._prevPos)return i;i&&this.setPaused(!0);var r=this._prevPos;if(this.position=this._prevPos=n,this._prevPosition=t,this._target&&this._steps.length>0){for(var o=this._steps.length,u=-1,a=0;o>a&&!("step"==this._steps[a].type&&(u=a,this._steps[a].t<=n&&this._steps[a].t+this._steps[a].d>=n));a++);for(var a=0;o>a;a++)if("action"==this._steps[a].type)0!=e&&(this._useTicks?this._runAction(this._steps[a],n,n):1==e&&r>n?(r!=this.duration&&this._runAction(this._steps[a],r,this.duration),this._runAction(this._steps[a],0,n,!0)):this._runAction(this._steps[a],r,n));else if("step"==this._steps[a].type&&u==a){var p=this._steps[u];this._updateTargetProps(p,Math.min((this._stepPosition=n-p.t)/p.d,1))}}return this.dispatchEventWith("change"),i},n.prototype._runAction=function(t,e,n,i){void 0===i&&(i=!1);var s=e,r=n;e>n&&(s=n,r=e);var o=t.t;(o==r||o>s&&r>o||i&&o==e)&&t.f.apply(t.o,t.p)},n.prototype._updateTargetProps=function(t,e){var i,s,r,o,u,a;if(t||1!=e){if(this.passive=!!t.v,this.passive)return;t.e&&(e=t.e(e,0,1,1)),i=t.p0,s=t.p1}else this.passive=!1,i=s=this._curQueueProps;for(var p in this._initQueueProps){null==(o=i[p])&&(i[p]=o=this._initQueueProps[p]),null==(u=s[p])&&(s[p]=u=o),r=o==u||0==e||1==e||"number"!=typeof o?1==e?u:o:o+(u-o)*e;var h=!1;if(a=n._plugins[p])for(var c=0,_=a.length;_>c;c++){var f=a[c].tween(this,p,r,i,s,e,!!t&&i==s,!t);f==n.IGNORE?h=!0:r=f}h||(this._target[p]=r)}},n.prototype.setPaused=function(t){return this.paused==t?this:(this.paused=t,n._register(this,!t),this)},n.prototype._cloneProps=function(t){var e={};for(var n in t)e[n]=t[n];return e},n.prototype._addStep=function(t){return t.d>0&&(t.type="step",this._steps.push(t),t.t=this.duration,this.duration+=t.d),this},n.prototype._appendQueueProps=function(t){var e,i,s,r,o;for(var u in t)if(void 0===this._initQueueProps[u]){if(i=this._target[u],e=n._plugins[u])for(s=0,r=e.length;r>s;s++)i=e[s].init(this,u,i);this._initQueueProps[u]=this._curQueueProps[u]=void 0===i?null:i}else i=this._curQueueProps[u];for(var u in t){if(i=this._curQueueProps[u],e=n._plugins[u])for(o=o||{},s=0,r=e.length;r>s;s++)e[s].step&&e[s].step(this,u,i,t[u],o);this._curQueueProps[u]=t[u]}return o&&this._appendQueueProps(o),this._curQueueProps},n.prototype._addAction=function(t){return t.t=this.duration,t.type="action",this._steps.push(t),this},n.prototype._set=function(t,e){for(var n in t)e[n]=t[n]},n.prototype.wait=function(t,e){if(null==t||0>=t)return this;var n=this._cloneProps(this._curQueueProps);return this._addStep({d:t,p0:n,p1:n,v:e})},n.prototype.to=function(t,e,n){return void 0===n&&(n=void 0),(isNaN(e)||0>e)&&(e=0),this._addStep({d:e||0,p0:this._cloneProps(this._curQueueProps),e:n,p1:this._cloneProps(this._appendQueueProps(t))}),this.set(t)},n.prototype.call=function(t,e,n){return void 0===e&&(e=void 0),void 0===n&&(n=void 0),this._addAction({f:t,p:n?n:[],o:e?e:this._target})},n.prototype.set=function(t,e){return void 0===e&&(e=null),this._appendQueueProps(t),this._addAction({f:this._set,o:this,p:[t,e?e:this._target]})},n.prototype.play=function(t){return t||(t=this),this.call(t.setPaused,t,[!1])},n.prototype.pause=function(t){return t||(t=this),this.call(t.setPaused,t,[!0])},n.prototype.$tick=function(t){this.paused||this.setPosition(this._prevPosition+t)},n.NONE=0,n.LOOP=1,n.REVERSE=2,n._tweens=[],n.IGNORE={},n._plugins={},n._inited=!1,n._lastTime=0,n}(t.EventDispatcher);t.Tween=e,__reflect(e.prototype,"egret.Tween")}(egret||(egret={}));var egret;!function(t){var e;!function(e){function n(e){if("function"==typeof e)return e;var n=t.Ease[e];return"function"==typeof n?n:null}function i(t,e,n,i){var s=t.prototype;s.__meta__=s.__meta__||{},s.__meta__[e]=n,i&&(s.__defaultProperty__=e)}var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="",e}return __extends(e,t),e}(t.EventDispatcher);e.BasePath=s,__reflect(s.prototype,"egret.tween.BasePath");var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e.duration=500,e.ease=void 0,e}return __extends(e,t),e}(s);e.To=r,__reflect(r.prototype,"egret.tween.To");var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.duration=500,e.passive=void 0,e}return __extends(e,t),e}(s);e.Wait=o,__reflect(o.prototype,"egret.tween.Wait");var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e}return __extends(e,t),e}(s);e.Set=u,__reflect(u.prototype,"egret.tween.Set");var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.delta=0,e}return __extends(e,t),e}(s);e.Tick=a,__reflect(a.prototype,"egret.tween.Tick");var p=function(e){function i(){var t=e.call(this)||this;return t.isStop=!1,t}return __extends(i,e),Object.defineProperty(i.prototype,"props",{get:function(){return this._props},set:function(t){this._props=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"target",{get:function(){return this._target},set:function(t){this._target=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paths",{get:function(){return this._paths},set:function(t){this._paths=t||[]},enumerable:!0,configurable:!0}),i.prototype.play=function(t){this.tween?(this.tween.setPaused(!1),this.isStop&&void 0==t&&(t=0,this.isStop=!1),void 0!==t&&null!==t&&this.tween.setPosition(t)):this.createTween(t)},i.prototype.pause=function(){this.tween&&this.tween.setPaused(!0)},i.prototype.stop=function(){this.pause(),this.isStop=!0},i.prototype.createTween=function(e){this.tween=t.Tween.get(this._target,this._props),this._paths&&this.applyPaths(),void 0!==e&&null!==e&&this.tween.setPosition(e)},i.prototype.applyPaths=function(){for(var t=0;t=0&&e===this._paths.length-1&&this.dispatchEventWith("complete")},i}(t.EventDispatcher);e.TweenItem=p,__reflect(p.prototype,"egret.tween.TweenItem"),i(p,"paths","Array",!0);var h=function(t){function e(){var e=t.call(this)||this;return e.completeCount=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(t){this.completeCount=0,this.registerEvent(!1),this._items=t,this.registerEvent(!0)},enumerable:!0,configurable:!0}),e.prototype.registerEvent=function(t){var e=this;this._items&&this._items.forEach(function(n){t?n.addEventListener("complete",e.itemComplete,e):n.removeEventListener("complete",e.itemComplete,e)})},e.prototype.play=function(t){if(this._items)for(var e=0;et&&(t=-1),t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},e.getPowIn=function(t){return function(e){return Math.pow(e,t)}},e.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},e.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},e.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},e.sineOut=function(t){return Math.sin(t*Math.PI/2)},e.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},e.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},e.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},e.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},e.circOut=function(t){return Math.sqrt(1- --t*t)},e.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},e.bounceIn=function(t){return 1-e.bounceOut(1-t)},e.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},e.bounceInOut=function(t){return.5>t?.5*e.bounceIn(2*t):.5*e.bounceOut(2*t-1)+.5},e.getElasticIn=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return-(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e))}},e.getElasticOut=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*n/e)+1}},e.getElasticInOut=function(t,e){var n=2*Math.PI;return function(i){var s=e/n*Math.asin(1/t);return(i*=2)<1?-.5*(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e)):t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*n/e)*.5+1}},e.quadIn=e.getPowIn(2),e.quadOut=e.getPowOut(2),e.quadInOut=e.getPowInOut(2),e.cubicIn=e.getPowIn(3),e.cubicOut=e.getPowOut(3),e.cubicInOut=e.getPowInOut(3),e.quartIn=e.getPowIn(4),e.quartOut=e.getPowOut(4),e.quartInOut=e.getPowInOut(4),e.quintIn=e.getPowIn(5),e.quintOut=e.getPowOut(5),e.quintInOut=e.getPowInOut(5),e.backIn=e.getBackIn(1.7),e.backOut=e.getBackOut(1.7),e.backInOut=e.getBackInOut(1.7),e.elasticIn=e.getElasticIn(1,.3),e.elasticOut=e.getElasticOut(1,.3),e.elasticInOut=e.getElasticInOut(1,.3*1.5),e}();t.Ease=e,__reflect(e.prototype,"egret.Ease")}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,i){var s=e.call(this)||this;return s._target=null,s._useTicks=!1,s.ignoreGlobalPause=!1,s.loop=!1,s.pluginData=null,s._steps=null,s.paused=!1,s.duration=0,s._prevPos=-1,s.position=null,s._prevPosition=0,s._stepPosition=0,s.passive=!1,s.initialize(t,n,i),s}return __extends(n,e),n.get=function(t,e,i,s){return void 0===i&&(i=null),void 0===s&&(s=!1),s&&n.removeTweens(t),new n(t,e,i)},n.removeTweens=function(t){if(t.tween_count){for(var e=n._tweens,i=e.length-1;i>=0;i--)e[i]._target==t&&(e[i].paused=!0,e.splice(i,1));t.tween_count=0}},n.pauseTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!0)},n.resumeTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!1)},n.tick=function(t,e){void 0===e&&(e=!1);var i=t-n._lastTime;n._lastTime=t;for(var s=n._tweens.concat(),r=s.length-1;r>=0;r--){var o=s[r];e&&!o.ignoreGlobalPause||o.paused||o.$tick(o._useTicks?1:i)}return!1},n._register=function(e,i){var s=e._target,r=n._tweens;if(i)s&&(s.tween_count=s.tween_count>0?s.tween_count+1:1),r.push(e),n._inited||(n._lastTime=t.getTimer(),t.ticker.$startTick(n.tick,null),n._inited=!0);else{s&&s.tween_count--;for(var o=r.length;o--;)if(r[o]==e)return void r.splice(o,1)}},n.removeAllTweens=function(){for(var t=n._tweens,e=0,i=t.length;i>e;e++){var s=t[e];s.paused=!0,s._target.tween_count=0}t.length=0},n.prototype.initialize=function(t,e,i){this._target=t,e&&(this._useTicks=e.useTicks,this.ignoreGlobalPause=e.ignoreGlobalPause,this.loop=e.loop,e.onChange&&this.addEventListener("change",e.onChange,e.onChangeObj),e.override&&n.removeTweens(t)),this.pluginData=i||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],e&&e.paused?this.paused=!0:n._register(this,!0),e&&null!=e.position&&this.setPosition(e.position,n.NONE)},n.prototype.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var n=t,i=!1;if(n>=this.duration)if(this.loop){var s=n%this.duration;n=n>0&&0===s?this.duration:s}else n=this.duration,i=!0;if(n==this._prevPos)return i;i&&this.setPaused(!0);var r=this._prevPos;if(this.position=this._prevPos=n,this._prevPosition=t,this._target&&this._steps.length>0){for(var o=this._steps.length,u=-1,a=0;o>a&&!("step"==this._steps[a].type&&(u=a,this._steps[a].t<=n&&this._steps[a].t+this._steps[a].d>=n));a++);for(var a=0;o>a;a++)if("action"==this._steps[a].type)0!=e&&(this._useTicks?this._runAction(this._steps[a],n,n):1==e&&r>n?(r!=this.duration&&this._runAction(this._steps[a],r,this.duration),this._runAction(this._steps[a],0,n,!0)):this._runAction(this._steps[a],r,n));else if("step"==this._steps[a].type&&u==a){var p=this._steps[u];this._updateTargetProps(p,Math.min((this._stepPosition=n-p.t)/p.d,1))}}return this.dispatchEventWith("change"),i},n.prototype._runAction=function(t,e,n,i){void 0===i&&(i=!1);var s=e,r=n;e>n&&(s=n,r=e);var o=t.t;(o==r||o>s&&r>o||i&&o==e)&&t.f.apply(t.o,t.p)},n.prototype._updateTargetProps=function(t,e){var i,s,r,o,u,a;if(t||1!=e){if(this.passive=!!t.v,this.passive)return;t.e&&(e=t.e(e,0,1,1)),i=t.p0,s=t.p1}else this.passive=!1,i=s=this._curQueueProps;for(var p in this._initQueueProps){null==(o=i[p])&&(i[p]=o=this._initQueueProps[p]),null==(u=s[p])&&(s[p]=u=o),r=o==u||0==e||1==e||"number"!=typeof o?1==e?u:o:o+(u-o)*e;var h=!1;if(a=n._plugins[p])for(var c=0,_=a.length;_>c;c++){var f=a[c].tween(this,p,r,i,s,e,!!t&&i==s,!t);f==n.IGNORE?h=!0:r=f}h||(this._target[p]=r)}},n.prototype.setPaused=function(t){return this.paused==t?this:(this.paused=t,n._register(this,!t),this)},n.prototype._cloneProps=function(t){var e={};for(var n in t)e[n]=t[n];return e},n.prototype._addStep=function(t){return t.d>0&&(t.type="step",this._steps.push(t),t.t=this.duration,this.duration+=t.d),this},n.prototype._appendQueueProps=function(t){var e,i,s,r,o;for(var u in t)if(void 0===this._initQueueProps[u]){if(i=this._target[u],e=n._plugins[u])for(s=0,r=e.length;r>s;s++)i=e[s].init(this,u,i);this._initQueueProps[u]=this._curQueueProps[u]=void 0===i?null:i}else i=this._curQueueProps[u];for(var u in t){if(i=this._curQueueProps[u],e=n._plugins[u])for(o=o||{},s=0,r=e.length;r>s;s++)e[s].step&&e[s].step(this,u,i,t[u],o);this._curQueueProps[u]=t[u]}return o&&this._appendQueueProps(o),this._curQueueProps},n.prototype._addAction=function(t){return t.t=this.duration,t.type="action",this._steps.push(t),this},n.prototype._set=function(t,e){for(var n in t)e[n]=t[n]},n.prototype.wait=function(t,e){if(null==t||0>=t)return this;var n=this._cloneProps(this._curQueueProps);return this._addStep({d:t,p0:n,p1:n,v:e})},n.prototype.to=function(t,e,n){return void 0===n&&(n=void 0),(isNaN(e)||0>e)&&(e=0),this._addStep({d:e||0,p0:this._cloneProps(this._curQueueProps),e:n,p1:this._cloneProps(this._appendQueueProps(t))}),this.set(t)},n.prototype.call=function(t,e,n){return void 0===e&&(e=void 0),void 0===n&&(n=void 0),this._addAction({f:t,p:n?n:[],o:e?e:this._target})},n.prototype.set=function(t,e){return void 0===e&&(e=null),this._appendQueueProps(t),this._addAction({f:this._set,o:this,p:[t,e?e:this._target]})},n.prototype.play=function(t){return t||(t=this),this.call(t.setPaused,t,[!1])},n.prototype.pause=function(t){return t||(t=this),this.call(t.setPaused,t,[!0])},n.prototype.$tick=function(t){this.paused||this.setPosition(this._prevPosition+t)},n.NONE=0,n.LOOP=1,n.REVERSE=2,n._tweens=[],n.IGNORE={},n._plugins={},n._inited=!1,n._lastTime=0,n}(t.EventDispatcher);t.Tween=e,__reflect(e.prototype,"egret.Tween")}(egret||(egret={}));var egret;!function(t){var e;!function(e){function n(e){if("function"==typeof e)return e;var n=t.Ease[e];return"function"==typeof n?n:null}function i(t,e,n,i){var s=t.prototype;s.__meta__=s.__meta__||{},s.__meta__[e]=n,i&&(s.__defaultProperty__=e)}var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="",e}return __extends(e,t),e}(t.EventDispatcher);e.BasePath=s,__reflect(s.prototype,"egret.tween.BasePath");var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e.duration=500,e.ease=void 0,e}return __extends(e,t),e}(s);e.To=r,__reflect(r.prototype,"egret.tween.To");var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.duration=500,e.passive=void 0,e}return __extends(e,t),e}(s);e.Wait=o,__reflect(o.prototype,"egret.tween.Wait");var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e}return __extends(e,t),e}(s);e.Set=u,__reflect(u.prototype,"egret.tween.Set");var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.delta=0,e}return __extends(e,t),e}(s);e.Tick=a,__reflect(a.prototype,"egret.tween.Tick");var p=function(e){function i(){var t=e.call(this)||this;return t.isStop=!1,t}return __extends(i,e),Object.defineProperty(i.prototype,"props",{get:function(){return this._props},set:function(t){this._props=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"target",{get:function(){return this._target},set:function(t){this._target=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paths",{get:function(){return this._paths},set:function(t){this._paths=t||[]},enumerable:!0,configurable:!0}),i.prototype.play=function(t){this.tween?(this.tween.setPaused(!1),this.isStop&&void 0==t&&(t=0,this.isStop=!1),void 0!==t&&null!==t&&this.tween.setPosition(t)):this.createTween(t)},i.prototype.pause=function(){this.tween&&this.tween.setPaused(!0)},i.prototype.stop=function(){this.pause(),this.isStop=!0},i.prototype.createTween=function(e){this.tween=t.Tween.get(this._target,this._props),this._paths&&this.applyPaths(),void 0!==e&&null!==e&&this.tween.setPosition(e)},i.prototype.applyPaths=function(){for(var t=0;t=0&&e===this._paths.length-1&&this.dispatchEventWith("complete")},i}(t.EventDispatcher);e.TweenItem=p,__reflect(p.prototype,"egret.tween.TweenItem"),i(p,"paths","Array",!0);var h=function(t){function e(){var e=t.call(this)||this;return e.completeCount=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(t){this.completeCount=0,this.registerEvent(!1),this._items=t,this.registerEvent(!0)},enumerable:!0,configurable:!0}),e.prototype.registerEvent=function(t){var e=this;this._items&&this._items.forEach(function(n){t?n.addEventListener("complete",e.itemComplete,e):n.removeEventListener("complete",e.itemComplete,e)})},e.prototype.play=function(t){if(this._items)for(var e=0;et&&(t=-1),t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},e.getPowIn=function(t){return function(e){return Math.pow(e,t)}},e.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},e.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},e.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},e.sineOut=function(t){return Math.sin(t*Math.PI/2)},e.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},e.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},e.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},e.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},e.circOut=function(t){return Math.sqrt(1- --t*t)},e.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},e.bounceIn=function(t){return 1-e.bounceOut(1-t)},e.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},e.bounceInOut=function(t){return.5>t?.5*e.bounceIn(2*t):.5*e.bounceOut(2*t-1)+.5},e.getElasticIn=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return-(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e))}},e.getElasticOut=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*n/e)+1}},e.getElasticInOut=function(t,e){var n=2*Math.PI;return function(i){var s=e/n*Math.asin(1/t);return(i*=2)<1?-.5*(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e)):t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*n/e)*.5+1}},e.quadIn=e.getPowIn(2),e.quadOut=e.getPowOut(2),e.quadInOut=e.getPowInOut(2),e.cubicIn=e.getPowIn(3),e.cubicOut=e.getPowOut(3),e.cubicInOut=e.getPowInOut(3),e.quartIn=e.getPowIn(4),e.quartOut=e.getPowOut(4),e.quartInOut=e.getPowInOut(4),e.quintIn=e.getPowIn(5),e.quintOut=e.getPowOut(5),e.quintInOut=e.getPowInOut(5),e.backIn=e.getBackIn(1.7),e.backOut=e.getBackOut(1.7),e.backInOut=e.getBackInOut(1.7),e.elasticIn=e.getElasticIn(1,.3),e.elasticOut=e.getElasticOut(1,.3),e.elasticInOut=e.getElasticInOut(1,.3*1.5),e}();t.Ease=e,__reflect(e.prototype,"egret.Ease")}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,i){var s=e.call(this)||this;return s._target=null,s._useTicks=!1,s.ignoreGlobalPause=!1,s.loop=!1,s.pluginData=null,s._steps=null,s.paused=!1,s.duration=0,s._prevPos=-1,s.position=null,s._prevPosition=0,s._stepPosition=0,s.passive=!1,s.initialize(t,n,i),s}return __extends(n,e),n.get=function(t,e,i,s){return void 0===i&&(i=null),void 0===s&&(s=!1),s&&n.removeTweens(t),new n(t,e,i)},n.removeTweens=function(t){if(t.tween_count){for(var e=n._tweens,i=e.length-1;i>=0;i--)e[i]._target==t&&(e[i].paused=!0,e.splice(i,1));t.tween_count=0}},n.pauseTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!0)},n.resumeTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!1)},n.tick=function(t,e){void 0===e&&(e=!1);var i=t-n._lastTime;n._lastTime=t;for(var s=n._tweens.concat(),r=s.length-1;r>=0;r--){var o=s[r];e&&!o.ignoreGlobalPause||o.paused||o.$tick(o._useTicks?1:i)}return!1},n._register=function(e,i){var s=e._target,r=n._tweens;if(i)s&&(s.tween_count=s.tween_count>0?s.tween_count+1:1),r.push(e),n._inited||(n._lastTime=t.getTimer(),t.ticker.$startTick(n.tick,null),n._inited=!0);else{s&&s.tween_count--;for(var o=r.length;o--;)if(r[o]==e)return void r.splice(o,1)}},n.removeAllTweens=function(){for(var t=n._tweens,e=0,i=t.length;i>e;e++){var s=t[e];s.paused=!0,s._target.tween_count=0}t.length=0},n.prototype.initialize=function(t,e,i){this._target=t,e&&(this._useTicks=e.useTicks,this.ignoreGlobalPause=e.ignoreGlobalPause,this.loop=e.loop,e.onChange&&this.addEventListener("change",e.onChange,e.onChangeObj),e.override&&n.removeTweens(t)),this.pluginData=i||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],e&&e.paused?this.paused=!0:n._register(this,!0),e&&null!=e.position&&this.setPosition(e.position,n.NONE)},n.prototype.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var n=t,i=!1;if(n>=this.duration)if(this.loop){var s=n%this.duration;n=n>0&&0===s?this.duration:s}else n=this.duration,i=!0;if(n==this._prevPos)return i;i&&this.setPaused(!0);var r=this._prevPos;if(this.position=this._prevPos=n,this._prevPosition=t,this._target&&this._steps.length>0){for(var o=this._steps.length,u=-1,a=0;o>a&&!("step"==this._steps[a].type&&(u=a,this._steps[a].t<=n&&this._steps[a].t+this._steps[a].d>=n));a++);for(var a=0;o>a;a++)if("action"==this._steps[a].type)0!=e&&(this._useTicks?this._runAction(this._steps[a],n,n):1==e&&r>n?(r!=this.duration&&this._runAction(this._steps[a],r,this.duration),this._runAction(this._steps[a],0,n,!0)):this._runAction(this._steps[a],r,n));else if("step"==this._steps[a].type&&u==a){var p=this._steps[u];this._updateTargetProps(p,Math.min((this._stepPosition=n-p.t)/p.d,1))}}return this.dispatchEventWith("change"),i},n.prototype._runAction=function(t,e,n,i){void 0===i&&(i=!1);var s=e,r=n;e>n&&(s=n,r=e);var o=t.t;(o==r||o>s&&r>o||i&&o==e)&&t.f.apply(t.o,t.p)},n.prototype._updateTargetProps=function(t,e){var i,s,r,o,u,a;if(t||1!=e){if(this.passive=!!t.v,this.passive)return;t.e&&(e=t.e(e,0,1,1)),i=t.p0,s=t.p1}else this.passive=!1,i=s=this._curQueueProps;for(var p in this._initQueueProps){null==(o=i[p])&&(i[p]=o=this._initQueueProps[p]),null==(u=s[p])&&(s[p]=u=o),r=o==u||0==e||1==e||"number"!=typeof o?1==e?u:o:o+(u-o)*e;var h=!1;if(a=n._plugins[p])for(var c=0,_=a.length;_>c;c++){var f=a[c].tween(this,p,r,i,s,e,!!t&&i==s,!t);f==n.IGNORE?h=!0:r=f}h||(this._target[p]=r)}},n.prototype.setPaused=function(t){return this.paused==t?this:(this.paused=t,n._register(this,!t),this)},n.prototype._cloneProps=function(t){var e={};for(var n in t)e[n]=t[n];return e},n.prototype._addStep=function(t){return t.d>0&&(t.type="step",this._steps.push(t),t.t=this.duration,this.duration+=t.d),this},n.prototype._appendQueueProps=function(t){var e,i,s,r,o;for(var u in t)if(void 0===this._initQueueProps[u]){if(i=this._target[u],e=n._plugins[u])for(s=0,r=e.length;r>s;s++)i=e[s].init(this,u,i);this._initQueueProps[u]=this._curQueueProps[u]=void 0===i?null:i}else i=this._curQueueProps[u];for(var u in t){if(i=this._curQueueProps[u],e=n._plugins[u])for(o=o||{},s=0,r=e.length;r>s;s++)e[s].step&&e[s].step(this,u,i,t[u],o);this._curQueueProps[u]=t[u]}return o&&this._appendQueueProps(o),this._curQueueProps},n.prototype._addAction=function(t){return t.t=this.duration,t.type="action",this._steps.push(t),this},n.prototype._set=function(t,e){for(var n in t)e[n]=t[n]},n.prototype.wait=function(t,e){if(null==t||0>=t)return this;var n=this._cloneProps(this._curQueueProps);return this._addStep({d:t,p0:n,p1:n,v:e})},n.prototype.to=function(t,e,n){return void 0===n&&(n=void 0),(isNaN(e)||0>e)&&(e=0),this._addStep({d:e||0,p0:this._cloneProps(this._curQueueProps),e:n,p1:this._cloneProps(this._appendQueueProps(t))}),this.set(t)},n.prototype.call=function(t,e,n){return void 0===e&&(e=void 0),void 0===n&&(n=void 0),this._addAction({f:t,p:n?n:[],o:e?e:this._target})},n.prototype.set=function(t,e){return void 0===e&&(e=null),this._appendQueueProps(t),this._addAction({f:this._set,o:this,p:[t,e?e:this._target]})},n.prototype.play=function(t){return t||(t=this),this.call(t.setPaused,t,[!1])},n.prototype.pause=function(t){return t||(t=this),this.call(t.setPaused,t,[!0])},n.prototype.$tick=function(t){this.paused||this.setPosition(this._prevPosition+t)},n.NONE=0,n.LOOP=1,n.REVERSE=2,n._tweens=[],n.IGNORE={},n._plugins={},n._inited=!1,n._lastTime=0,n}(t.EventDispatcher);t.Tween=e,__reflect(e.prototype,"egret.Tween")}(egret||(egret={}));var egret;!function(t){var e;!function(e){function n(e){if("function"==typeof e)return e;var n=t.Ease[e];return"function"==typeof n?n:null}function i(t,e,n,i){var s=t.prototype;s.__meta__=s.__meta__||{},s.__meta__[e]=n,i&&(s.__defaultProperty__=e)}var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="",e}return __extends(e,t),e}(t.EventDispatcher);e.BasePath=s,__reflect(s.prototype,"egret.tween.BasePath");var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e.duration=500,e.ease=void 0,e}return __extends(e,t),e}(s);e.To=r,__reflect(r.prototype,"egret.tween.To");var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.duration=500,e.passive=void 0,e}return __extends(e,t),e}(s);e.Wait=o,__reflect(o.prototype,"egret.tween.Wait");var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e}return __extends(e,t),e}(s);e.Set=u,__reflect(u.prototype,"egret.tween.Set");var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.delta=0,e}return __extends(e,t),e}(s);e.Tick=a,__reflect(a.prototype,"egret.tween.Tick");var p=function(e){function i(){var t=e.call(this)||this;return t.isStop=!1,t}return __extends(i,e),Object.defineProperty(i.prototype,"props",{get:function(){return this._props},set:function(t){this._props=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"target",{get:function(){return this._target},set:function(t){this._target=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paths",{get:function(){return this._paths},set:function(t){this._paths=t||[]},enumerable:!0,configurable:!0}),i.prototype.play=function(t){this.tween?(this.tween.setPaused(!1),this.isStop&&void 0==t&&(t=0,this.isStop=!1),void 0!==t&&null!==t&&this.tween.setPosition(t)):this.createTween(t)},i.prototype.pause=function(){this.tween&&this.tween.setPaused(!0)},i.prototype.stop=function(){this.pause(),this.isStop=!0},i.prototype.createTween=function(e){this.tween=t.Tween.get(this._target,this._props),this._paths&&this.applyPaths(),void 0!==e&&null!==e&&this.tween.setPosition(e)},i.prototype.applyPaths=function(){for(var t=0;t=0&&e===this._paths.length-1&&this.dispatchEventWith("complete")},i}(t.EventDispatcher);e.TweenItem=p,__reflect(p.prototype,"egret.tween.TweenItem"),i(p,"paths","Array",!0);var h=function(t){function e(){var e=t.call(this)||this;return e.completeCount=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(t){this.completeCount=0,this.registerEvent(!1),this._items=t,this.registerEvent(!0)},enumerable:!0,configurable:!0}),e.prototype.registerEvent=function(t){var e=this;this._items&&this._items.forEach(function(n){t?n.addEventListener("complete",e.itemComplete,e):n.removeEventListener("complete",e.itemComplete,e)})},e.prototype.play=function(t){if(this._items)for(var e=0;e