Commit 81154e79 authored by 熊东起's avatar 熊东起

666

parent 65485d09
...@@ -99,6 +99,7 @@ export class GameIndex extends GAME.WidgetBase { ...@@ -99,6 +99,7 @@ export class GameIndex extends GAME.WidgetBase {
this.onMove(); this.onMove();
break; break;
case "refresh-data": case "refresh-data":
this._index = 0;
GameMgr.options.curSteps = data.curSteps; GameMgr.options.curSteps = data.curSteps;
GameMgr.GAME_STEP = data.gameSteps; GameMgr.GAME_STEP = data.gameSteps;
GameMgr.SITE_NAME = data.siteName; GameMgr.SITE_NAME = data.siteName;
...@@ -190,7 +191,7 @@ export class GameIndex extends GAME.WidgetBase { ...@@ -190,7 +191,7 @@ export class GameIndex extends GAME.WidgetBase {
/** 盖住移动的人物 */ /** 盖住移动的人物 */
private _index = 0; private _index = 0;
onMaskPlayer() { onMaskPlayer() {
if (this.player.y <= 4489 && this._index == 0) { if (this.player.y <= 4589 && this._index == 0) {
this._index++; this._index++;
this.gameMask.resetLayers(this._index); this.gameMask.resetLayers(this._index);
} else if (this.player.y <= 4400 && this._index == 1) { } else if (this.player.y <= 4400 && this._index == 1) {
......
...@@ -45,12 +45,36 @@ function App() { ...@@ -45,12 +45,36 @@ function App() {
} }
function onClickButton(type) { function onClickButton(type) {
_widget.dispatchInEvent(type,{curSteps: 220000,endSteps: 350000}) switch (type) {
case "game-start":
_widget.dispatchInEvent(type, { curSteps: 0, endSteps: 200000 })
break;
case "refresh-data":
_widget.dispatchInEvent(type, {
curSteps: 0,
gameSteps: [0, 10000, 30000, 100000, 200000, 350000],
siteName: [
"宝石山",
"金猪存钱罐",
"断桥残雪",
"平湖秋月",
"拆红包",
"苏堤春晓",
"曲苑风荷",
"打病毒",
"双峰插云"
],
linkList: []
});
break;
}
} }
return ( return (
<div className="App"> <div className="App">
<div className="control-bar"> <div className="control-bar">
<button onClick={e => onClickButton('refresh-data')}>refresh-data</button>
<button onClick={e => onClickButton('game-start')}>GO</button> <button onClick={e => onClickButton('game-start')}>GO</button>
</div> </div>
<CanvasWidget className="canvas-widget" widgetFactory={WalkCom} widgetConfig={widgetConfig} <CanvasWidget className="canvas-widget" widgetFactory={WalkCom} widgetConfig={widgetConfig}
......
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