Commit fee0effd authored by wildfirecode's avatar wildfirecode

1

parent 3f8c001b
......@@ -41,11 +41,11 @@
<!-- <script src="default.thm.js"></script> -->
<script src="output.js"></script>
<script>
localStorage.clear();
// localStorage.clear();
var __t0__ = Date.now();
var __debug__ = 1;
var __monkeyHandSize__ = 30;
var __boxMoveSpeed__ = 1;
var __boxMoveSpeed__ = 3;
var __BOX_CREATE_INTERVAL__ = 60*4;
var __boxOpenState__ = 'resource/assets/startScene/openstate.json';
var __boxmap__ = {
......
......@@ -37,8 +37,7 @@ export default class MainBase extends eui.UILayer {
//生效情况
//RES.getResByUrl jpg or png类型
//RES.getResAsync('monkey_png')
if(filename.indexOf('png')!=-1||filename.indexOf('jpg')!=-1)
console.log('已经处理:',filename)
if (filename.indexOf('png') != -1 || filename.indexOf('jpg') != -1)
result = JSON.parse(JSON.stringify(result));
// result.url = result.url.replace('.png', '.png?x-oss-process=image/format,webp');
result.url = result.url.replace('.jpg', '.jpg?x-oss-process=image/format,webp');
......
......@@ -82,7 +82,7 @@ export default class Box extends egret.Sprite {
});
}
private _vyStart = 12;
private _vyStart = 25;
private _vy: number;
private _gy: number;
private _throwStartVY: number;
......@@ -93,14 +93,16 @@ export default class Box extends egret.Sprite {
const scale = (this._vyStart * this._scaleMax - Math.abs(this._vy)) / this._vyStart;
this.scaleX = this.scaleY = scale;
}
doThrow(): any {
this._pic.stopAtIdleFrame();
this._throwStartVY = this._vy;
this._vy = -this._vyStart;
this._gy = .2;
this._gy = .55;
this.y = Box.MIDDLE_Y;
}
get vy(){return this._vy}
get vy() { return this._vy }
get type() { return this._type }
get boxData() { return __boxmap__[this._type] }
......
import { getResPath } from "../utils";
export default class Monkey extends egret.Sprite {
private h = 525;
private w = 265;
......
......@@ -26,7 +26,7 @@ export default class Net extends egret.Sprite {
let url = getResPath() + `resource/assets/startScene/net.json`;
RES.getResByUrl(url, (sheet: egret.SpriteSheet) => {
this._pic.sheet = sheet;
this._pic.fps = 10;
this._pic.fps = 20;
this.alpha = 0;
egret.Tween.get(this).to({ alpha: 1 }, 500);
// setInterval(() => {
......
......@@ -53,11 +53,8 @@ export default class StartScene extends Scene {
this._debug = new debug(this.getLayer(LayerTypes.top));
}
const model = new GamePlayModel();
model.update();
// box.touchEnabled = true;
// box.addEventListener(egret.TouchEvent.TOUCH_BEGIN, () => {
// NetManager.ins.getInfo(() => {
......@@ -81,7 +78,7 @@ export default class StartScene extends Scene {
private _catchedBox: Box;
private _cathchedBoxOpenState: BoxOpenState;
onTouch() {
async onTouch() {
this._net.doAction();
const catchedBoxs = this._boxListCtrl.boxs.filter(
box => Math.abs(box.y - Box.MIDDLE_Y) < StartScene.NET_RANGE);
......@@ -113,8 +110,7 @@ export default class StartScene extends Scene {
const dis = 100 + __monkeyHandSize__;
if (disX < dis && disY < dis) {
this.onCatchedByMonkey();
}
else if (this._catchedBox.vy > 0) {
} else if (this._catchedBox.vy > 0) {
this.onNotCatchedByMonkey();
}
}
......@@ -130,6 +126,7 @@ export default class StartScene extends Scene {
.to({ alpha: 0 }, 500).call(() => {
this._catchedBoxByMoneky.destroy();
this._catchedBoxByMoneky = null;
this.boxListCtrl.resume();
}, this);
}
......@@ -144,10 +141,12 @@ export default class StartScene extends Scene {
this._catchedBox = null;
}
this._cathchedBoxOpenState.start();
setTimeout(() => {
this._cathchedBoxOpenState.destroy();
this._cathchedBoxOpenState = null;
},1000);
this.boxListCtrl.resume();
}, 1000);
}
private _handX: number;
......
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