Commit fee0effd authored by wildfirecode's avatar wildfirecode

1

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