Commit b1e98e06 authored by wildfirecode's avatar wildfirecode

1

parents e84672cf 1a096253
......@@ -32,11 +32,13 @@ import FailedPanel from "../../src/panels/FailedPanel";
import QuitPanel from "../../src/panels/QuitPanel";
import BoxPanel from "../../src/panels/BoxPanel";
import MainScene from "../../src/mainScene/MainScene";
import { Loading2 } from "../../src/something/uis/Loading2";
export default class MainBase extends eui.UILayer {
constructor() {
super();
Loading.instace.loadImage();
Loading2.instace.loadImage();
DataManager.ins.customCfgData = window['CFG'];
this.getData();
}
......@@ -103,6 +105,7 @@ export default class MainBase extends eui.UILayer {
layers.init(this);
Loading.init(layers.topLayer);
Loading2.init(layers.topLayer);
Loading.instace.show();
PanelCtrl.instance.init(layers.popupLayer);
......
This diff is collapsed.
......@@ -9,12 +9,12 @@ export const Chapters: ChapterData[] = [
{
map: {
lattices: [
1, 1, 1, 0, 1, 1, 1, 1, 1,
1, 1, 1, 0, 2, 1, 1, 1, 1,
1, 1, 1, 0, 1, 3, 1, 1, 1,
1, 1, 1, 0, 1, 1, 4, 1, 1,
0, 0, 0, 0, 1, 1, 1, 5, 1,
1, 1, 1, 1, 1, 1, 1, 1, 6,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
......@@ -33,33 +33,16 @@ export const Chapters: ChapterData[] = [
]
}
],
connectedLats: [[27, 45], [28, 46], [29, 47]]
// connectedLats: [[27, 45], [28, 46], [29, 47]]
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.15,
stepCount: 30,
// passTarget: {
// type: PassType.SCORE_TARGET,
// score: 10000,
// },
effectInitProbability: 0.1,
stepCount: 50,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
// {
// type: ElementType.ICE,
// count: 100,
// },
{
type: ElementType.RABBIT,
count: 56,
},
{
type: ElementType.LOLLIPOP,
count: 4,
}
],
type: PassType.SCORE_TARGET,
score: 2000,
},
starScores: [3000, 5000, 10000]
starScores: [1200, 1500, 2500]
},
//第二关
{
......@@ -574,14 +557,14 @@ export const Chapters: ChapterData[] = [
generateLats: [0, 1, 2, 4, 5, 6, 7, 8],
connectedLats: [[27, 45], [28, 46], [29, 47]]
},
baseElementTypes: [0, 1, 2, 3],
baseElementTypes: [0, 1, 2, 4],
effectInitProbability: 0.05,
stepCount: 15,
passTarget: {
type: PassType.SCORE_TARGET,
score: 22000
score: 18000
},
starScores: [8000, 16000, 22000]
starScores: [8000, 12000, 18000]
},
//第二十关
{
......
export class Loading2 extends egret.Sprite {
private static _parent: egret.Sprite;
private static _instance: Loading2;
private static bg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAC0CAYAAAATiCegAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQwIDc5LjE2MDQ1MSwgMjAxNy8wNS8wNi0wMTowODoyMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXB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base64: string, callback: (bitmap) => void): void {
const img = new Image();
img["avaliable"] = true;
img.src = base64;
img.onload = () => {
const texture = new egret.Texture();
const bitmapdata = new egret.BitmapData(img);
texture._setBitmapData(bitmapdata);
callback(new egret.Bitmap(texture));
}
}
_bg: egret.Bitmap;
_progress: egret.Bitmap;
loadImage() {
var bg: egret.Shape = new egret.Shape();
bg.graphics.beginFill(0x000000, 0);
bg.graphics.drawRect(0, 0, 750, 1624);
bg.graphics.endFill();
bg.touchEnabled = true;
this.addChild(bg);
this.getBitmap(Loading2.bg, (bitmap: egret.Bitmap) => {
const t = Date.now() - window['__startTime__'];
console.log(`首屏loading显示时间:${t}ms`);
this._bg = bitmap;
this._bg.x = 295;
this._bg.y = 288;
this.addChild(this._bg);
})
this.getBitmap(Loading2.progress, (bitmap: egret.Bitmap) => {
this._progress = bitmap;
this._progress.x = 375;
this._progress.y = 380;
this._progress.anchorOffsetX = this._progress.anchorOffsetY = 28;
this.addChild(this._progress);
})
}
static get instace(): Loading2 {
return Loading2._instance || (Loading2._instance = new Loading2());
}
show() {
Loading2._parent.addChild(this);
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
hide() {
if (this.parent)
Loading2._parent.removeChild(this);
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
static init(parent: egret.Sprite) {
Loading2._parent = parent;
}
onEnterFrame() {
if (this._progress)
this._progress.rotation += 5;
}
}
......@@ -12,7 +12,6 @@ export class PropGuide extends egret.DisplayObjectContainer {
hammerBtn: egret.Bitmap;
stepBtn: egret.Bitmap;
msgTxt: egret.TextField;
stepCircle: egret.Shape;
constructor() {
super()
this.bg = new egret.Shape();
......@@ -40,12 +39,6 @@ export class PropGuide extends egret.DisplayObjectContainer {
text.width = 500;
this.addChild(text);
this.msgTxt = text;
//步数的圆
this.stepCircle = new egret.Shape();
this.stepCircle.graphics.beginFill(0xff0000, 0.5);
this.stepCircle.graphics.drawCircle(123, 98, 72);
this.stepCircle.graphics.endFill();
this.addChild(this.stepCircle);
this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (this.parent) this.parent.removeChild(this)
}, this)
......
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