Commit d7657c2d authored by wildfirecode's avatar wildfirecode

1

parent b1c28df0
......@@ -42,16 +42,18 @@
<!-- <script src="default.thm.js"></script> -->
<script src="output.js"></script>
<script>
var debug = 1;
var moneyHandSize = 40;
var boxmap = {
coin: 0,
gift: 0,
gift2: 0,
woodbox: 1, //木宝箱
silverbox: 3,//银宝箱
goldenbox: 5,//金宝箱
};
var debug = 1;
var moneyHandSize = 50;
var boxmap = {
coin: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/coin.png' },
gift: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/gift.png' },
gift2: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/gift2.png' },
woodbox: { award: 1, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/woodbox.png' }, //木宝箱
silverbox: { award: 3, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/silverbox.png' },//银宝箱
goldenbox: { award: 5, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/goldenbox.png' },//金宝箱
};
var __bgUrl__ = 'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/bg.jpg';
var gameId = 1;
var CFG = {
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert_2","version":5,"files":["../assets/alert/Bitmap-4.png","../assets/alert/Bitmap-2.png","../assets/alert/Bitmap-1.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"loading_1","version":5,"files":["../assets/loading/bg.png","../assets/loading/progress.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"msg_0","version":5,"files":["../assets/msg/msgBg.png","../assets/msg/x.png","../assets/msg/sureBtn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_3","version":5,"files":["../assets/rule/ruleBg.png","../assets/rule/X.png"]}
\ No newline at end of file
......@@ -15,10 +15,6 @@
{
"keys": "ruleBg_png,X_png",
"name": "rule"
},
{
"name": "preload",
"keys": "gift2_png,coin_png,gift_png,goldenbox_png,silverbox_png,woodbox_png"
}
],
"resources": [
......@@ -78,34 +74,34 @@
"name": "bg_jpg"
},
{
"name": "gift2_png",
"url": "assets/startScene/gift2.png",
"type": "image",
"url": "assets/startScene/gift2.png"
"name": "gift2_png"
},
{
"name": "coin_png",
"url": "assets/startScene/coin.png",
"type": "image",
"url": "assets/startScene/coin.png"
"name": "coin_png"
},
{
"name": "gift_png",
"url": "assets/startScene/gift.png",
"type": "image",
"url": "assets/startScene/gift.png"
"name": "gift_png"
},
{
"name": "goldenbox_png",
"url": "assets/startScene/goldenbox.png",
"type": "image",
"url": "assets/startScene/goldenbox.png"
"name": "goldenbox_png"
},
{
"name": "silverbox_png",
"url": "assets/startScene/silverbox.png",
"type": "image",
"url": "assets/startScene/silverbox.png"
"name": "silverbox_png"
},
{
"name": "woodbox_png",
"url": "assets/startScene/woodbox.png",
"type": "image",
"url": "assets/startScene/woodbox.png"
"name": "woodbox_png"
}
]
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ class Main extends MainBase {
}
protected async createGameScene() {
// await RES.getResAsync('bg_jpg');
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
}
......
......@@ -21,4 +21,15 @@ export default class Box extends egret.Sprite {
}
get type() { return this._type }
static getBoxList() {
const list = [];
for (const key in window['boxmap']) {
if (window['boxmap'].hasOwnProperty(key)) {
const element = window['boxmap'][key];
list.push(key);
}
}
return list;
}
}
\ No newline at end of file
export default class BoxType {
static coin = 'coin'
static gift = 'coin'
static gift2 = 'coin'
static goldenbox = 'coin'
static silverbox = 'coin'
static woodbox = 'coin'
}
\ No newline at end of file
export default interface IBoxItem {
award: number;
skin: string;
}
\ No newline at end of file
import { NetManager } from "../../libs/tw/manager/NetManager";
import { GamePlayModel } from "../../libs/tw/model/game/GamePlayModel";
import { getResPath } from "../utils";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import Scene from "../views/Scene";
import Box from "./Box";
import BoxType from "./BoxType";
import IBoxItem from "./IBoxItem";
import Monkey from "./Monkey";
import { NetManager } from "../../libs/tw/manager/NetManager";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
const { TouchEvent } = egret;
export default class StartScene extends Scene {
......@@ -18,7 +17,7 @@ export default class StartScene extends Scene {
const pic = new egret.Bitmap(picData);
this.addChild(pic);
const box = new Box(BoxType.coin);
const box = new Box(Box.getBoxList()[5]);
this.addChild(box);
box.x = box.stage.stageWidth / 2;
box.y = box.stage.stageHeight / 2;
......@@ -42,14 +41,15 @@ export default class StartScene extends Scene {
box.touchEnabled = true;
box.addEventListener(egret.TouchEvent.TOUCH_BEGIN, () => {
const boxData: IBoxItem = window['boxmap'][box.type];
NetManager.ins.getInfo(() => {
model.doStart(() => {
model.submit(() => { }, window['boxmap'][box.type])
model.submit(() => { }, boxData.award)
}, false);
});
NetManager.ins.getRule(() => {
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
})
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
}, this);
}
......@@ -66,7 +66,7 @@ export default class StartScene extends Scene {
}
}
async getBg() {
let url = getResPath() + 'resource/assets/startScene/bg.jpg';
let url = window['__bgUrl__']
return new Promise((resolve) => {
RES.getResByUrl(url, (picData) => {
resolve(picData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment