Commit 276189de authored by huangwenjie's avatar huangwenjie

1

parent a5dfe921
...@@ -30,7 +30,7 @@ window.addEventListener("load", function () { ...@@ -30,7 +30,7 @@ window.addEventListener("load", function () {
var r = document.createElement("script"); var r = document.createElement("script");
r.async = !0, r.src = "//yun.tuia.cn/tuia/skyeye/skyeye.js", r.crossOrigin = "anonymous", r.onerror = r.async = !0, r.src = "//yun.tuia.cn/tuia/skyeye/skyeye.js", r.crossOrigin = "anonymous", r.onerror =
function () { function () {
t-- , t > 0 && setTimeout(e, 1500) t--, t > 0 && setTimeout(e, 1500)
}, document.head && document.head.appendChild(r) }, document.head && document.head.appendChild(r)
}; };
setTimeout(n, 1500); setTimeout(n, 1500);
...@@ -62,7 +62,7 @@ export class Main { ...@@ -62,7 +62,7 @@ export class Main {
//隐藏加载中 //隐藏加载中
if (document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none"; if (document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
//打开开始场景 //打开开始场景
changeScene(StartScene);return; changeScene(PlayScene); return;
//获取数据,,必成功 //获取数据,,必成功
showWaiting(); showWaiting();
sendTbNet(TbNetName.getAppData, {}, (s, res) => { sendTbNet(TbNetName.getAppData, {}, (s, res) => {
......
import { PlayScene } from './playScene/PlayScene';
import Sprite from "../../engine/2d/display/Sprite"; import Sprite from "../../engine/2d/display/Sprite";
...@@ -25,7 +26,6 @@ import { AdvancedBloomFilter } from "../../engine/2d/filter/advanced-bloom/Advan ...@@ -25,7 +26,6 @@ import { AdvancedBloomFilter } from "../../engine/2d/filter/advanced-bloom/Advan
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { changeScene } from "../../module/ctrls"; import { changeScene } from "../../module/ctrls";
import { PlayScene } from "./PlayScene";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { NineSlicePlane } from '../../engine/2d/mesh'; import { NineSlicePlane } from '../../engine/2d/mesh';
import { Rope } from '../../engine/2d/mesh/Rope'; import { Rope } from '../../engine/2d/mesh/Rope';
...@@ -35,7 +35,7 @@ export class StartScene extends Scene { ...@@ -35,7 +35,7 @@ export class StartScene extends Scene {
get groupNames(): string[] { return ["startScene"] } get groupNames(): string[] { return ["startScene"] }
start() { start() {
super.start(); super.start();
// this.scaleX=0.5 // this.scaleX=0.5
// showPanel(PrizePanel) // showPanel(PrizePanel)
......
...@@ -113,6 +113,21 @@ export class PlayScene extends Scene { ...@@ -113,6 +113,21 @@ export class PlayScene extends Scene {
initEvents() { initEvents() {
super.initEvents() super.initEvents()
this.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown_this, this) this.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown_this, this)
this.addEventListener(MouseEvent.CLICK, this.onClick_exchangeBtn, this)
this.addEventListener(MouseEvent.CLICK, this.onClick_bombBtn, this)
this.addEventListener(MouseEvent.CLICK, this.onClick_filterBtn, this)
}
onClick_exchangeBtn() {
}
onClick_bombBtn() {
}
onClick_filterBtn() {
} }
startX startX
...@@ -144,6 +159,7 @@ export class PlayScene extends Scene { ...@@ -144,6 +159,7 @@ export class PlayScene extends Scene {
} }
onUp_this() { onUp_this() {
this.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMove_this, this) this.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMove_this, this)
this.removeEventListener(MouseEvent.MOUSE_UP, this.onUp_this, this) this.removeEventListener(MouseEvent.MOUSE_UP, this.onUp_this, this)
this.removeEventListener(MouseEvent.MOUSE_OUT, this.onUp_this, this) this.removeEventListener(MouseEvent.MOUSE_OUT, this.onUp_this, this)
...@@ -152,6 +168,15 @@ export class PlayScene extends Scene { ...@@ -152,6 +168,15 @@ export class PlayScene extends Scene {
this.offsetY = 0 this.offsetY = 0
} }
removeEvents() {
super.removeEvents()
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.onDown_this, this)
this.removeEventListener(MouseEvent.CLICK, this.onClick_exchangeBtn, this)
this.removeEventListener(MouseEvent.CLICK, this.onClick_bombBtn, this)
this.removeEventListener(MouseEvent.CLICK, this.onClick_filterBtn, this)
}
async checkMove() { async checkMove() {
if (Math.abs(this.offsetX) > Math.abs(this.offsetY)) { if (Math.abs(this.offsetX) > Math.abs(this.offsetY)) {
// 横向移动 // 横向移动
...@@ -302,11 +327,7 @@ export class PlayScene extends Scene { ...@@ -302,11 +327,7 @@ export class PlayScene extends Scene {
gamewin() { gamewin() {
// 游戏胜利 // 游戏胜利
} console.log("游戏胜利")
setScore() {
console.log(this.score);
} }
currMoveType currMoveType
...@@ -460,7 +481,6 @@ export class PlayScene extends Scene { ...@@ -460,7 +481,6 @@ export class PlayScene extends Scene {
//一次性走完就让 i = 0 例如 2240 =》8000 //一次性走完就让 i = 0 例如 2240 =》8000
//i = 0 //此处不能 i -= 1 [8,2,2,4]会出问题 //i = 0 //此处不能 i -= 1 [8,2,2,4]会出问题
this.score += arr[i - 1] this.score += arr[i - 1]
this.setScore()
} }
} }
} }
...@@ -505,16 +525,4 @@ export class PlayScene extends Scene { ...@@ -505,16 +525,4 @@ export class PlayScene extends Scene {
return false return false
} }
clone(obj) {
function Fn() { }
Fn.prototype = obj;
var o = new Fn();
for (var a in o) {
if (typeof o[a] == "object") {
o[a] = this.clone(o[a]);
}
}
return o;
}
} }
\ No newline at end of file
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