Commit d01ab80f authored by wildfirecode's avatar wildfirecode

1

parent 8ac8b381
...@@ -2,13 +2,17 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase"; ...@@ -2,13 +2,17 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import MapScene from "./MapScene"; import MapScene from "./MapScene";
import MapStarComp from "./MapStarComp"; import MapStarComp from "./MapStarComp";
import { createData } from "../startScene/StartScene";
export default class MapRpeatPart extends ComponentBase { export default class MapRpeatPart extends ComponentBase {
static LEVEL_NUMS = 13; static LEVEL_NUMS = 13;
private _index; private _index;
constructor(i) { private _topHeight;
constructor(i,topHeight) {
super(); super();
this._index = i; this._index = i;
this._topHeight=topHeight;
createData()
} }
start() { start() {
...@@ -28,6 +32,7 @@ export default class MapRpeatPart extends ComponentBase { ...@@ -28,6 +32,7 @@ export default class MapRpeatPart extends ComponentBase {
star.loadSkin(); star.start(); star.loadSkin(); star.start();
MapScene.starHash[levelOrder] = star; MapScene.starHash[levelOrder] = star;
icon.addChild(star); icon.addChild(star);
icon['visibleY'] = this._topHeight + this
} }
this['animal1'].visible = this._index % 2; this['animal1'].visible = this._index % 2;
......
...@@ -21,7 +21,7 @@ export default class MapTopPart extends ComponentBase { ...@@ -21,7 +21,7 @@ export default class MapTopPart extends ComponentBase {
this.removeChild(icon); this.removeChild(icon);
icon['mappart']=this; icon['mappart']=this;
icon.show = ()=>{this.addChild(icon)}; icon.show = ()=>{this.addChild(icon)};
console.log(icon.y) icon['visibleY'] = icon.y;
} }
} }
......
...@@ -120,7 +120,7 @@ export const createData = () => { ...@@ -120,7 +120,7 @@ export const createData = () => {
const repeatCount =getRepeatCount(); const repeatCount =getRepeatCount();
for (let i = 0; i < repeatCount; i++) { for (let i = 0; i < repeatCount; i++) {
const repeat = new MapRpeatPart(i); const repeat = new MapRpeatPart(i,startSceneData.top.height);
repeat.loadSkin(); repeat.start(); repeat.loadSkin(); repeat.start();
list.push(repeat); list.push(repeat);
} }
......
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