Commit c47ff5ff authored by wildfirecode's avatar wildfirecode

1

parent e7d34f26
...@@ -2671,8 +2671,9 @@ export default class MainScene extends Scene { ...@@ -2671,8 +2671,9 @@ export default class MainScene extends Scene {
* @param lat * @param lat
*/ */
iceBroken(lat: Lattice) { iceBroken(lat: Lattice) {
if (lat && lat.ice) { if (!lat) return;
var ice = lat.ice; if (lat.ice) {//带冰的lattice
const ice = lat.ice;
ice.countNum--; ice.countNum--;
if (ice.countNum == 0) { if (ice.countNum == 0) {
this.map.removeChild(ice); this.map.removeChild(ice);
...@@ -2683,9 +2684,23 @@ export default class MainScene extends Scene { ...@@ -2683,9 +2684,23 @@ export default class MainScene extends Scene {
} else { } else {
ice.alpha = 0.6; ice.alpha = 0.6;
} }
var p = Tool.getPositionByIndex(lat.index); const p = Tool.getPositionByIndex(lat.index);
//动画 //动画
this.playAni(RecoverName.ICE_ANI, p); this.playAni(RecoverName.ICE_ANI, p);
} else if (lat.block) {//石门(可能带冰)
const block = lat.block;
block.iceCountNum--;
if (block.iceCountNum == 0) {
block.ice && this.map.removeChild(block.ice);
block.ice = null;
this.goElementTarget(ElementType.ICE, [block.ice.x, block.ice.y]);
} else {
block.ice.alpha = 0.6;
}
const p = Tool.getPositionByIndex(lat.index);
//动画
this.playAni(RecoverName.ICE_ANI, p);
} }
} }
......
import BlockBase from "./BlockBase"; import BlockBase from "./BlockBase";
import centerAnchor from "./centerAnchor";
export default class Block extends egret.DisplayObjectContainer implements BlockBase { export default class Block extends egret.DisplayObjectContainer implements BlockBase {
constructor() { constructor() {
...@@ -18,6 +19,12 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc ...@@ -18,6 +19,12 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this.addChild(this._blockBgBlue); this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed); this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow); this.addChild(this._blockBgYellow);
centerAnchor(this._block);
centerAnchor(this._blockBgFront);
centerAnchor(this._blockBgBlue);
centerAnchor(this._blockBgRed);
centerAnchor(this._blockBgYellow);
this._block.visible = false; this._block.visible = false;
this._blockBgFront.visible = false; this._blockBgFront.visible = false;
this._blockBgBlue.visible = false; this._blockBgBlue.visible = false;
...@@ -27,6 +34,8 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc ...@@ -27,6 +34,8 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this.addAni(this._blockBgBlue); this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow); this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed); this.addAni(this._blockBgRed);
this._block.visible = true;
} }
private _blockBgYellow: egret.Bitmap; private _blockBgYellow: egret.Bitmap;
......
...@@ -19,5 +19,6 @@ export const genBlockDisplay = (type: LatticeType) => { ...@@ -19,5 +19,6 @@ export const genBlockDisplay = (type: LatticeType) => {
} }
export default interface BlockBase { export default interface BlockBase {
iceCountNum:number;
ice:egret.Bitmap;
} }
\ No newline at end of file
import BlockBase from "./BlockBase"; import BlockBase from "./BlockBase";
import { ElementType } from "../enum/ElementType";
export default class BlockDarkIce extends egret.DisplayObjectContainer implements BlockBase{ import centerAnchor from "./centerAnchor";
export default class BlockDarkIce extends egret.DisplayObjectContainer implements BlockBase {
constructor() { constructor() {
super(); super();
this.initUI(); this.initUI();
...@@ -12,12 +13,23 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement ...@@ -12,12 +13,23 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
this._blockBgBlue = new egret.Bitmap(RES.getRes('common_block_bg_blue_png')); this._blockBgBlue = new egret.Bitmap(RES.getRes('common_block_bg_blue_png'));
this._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_png')); this._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_png'));
this._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png')); this._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png'));
this.ice = new egret.Bitmap(RES.getRes("ele" + ElementType.ICE + "_png"));
this.ice.alpha = 1;
this.addChild(this.ice);
this.addChild(this._block); this.addChild(this._block);
this.addChild(this._blockBgFront); this.addChild(this._blockBgFront);
this.addChild(this._blockBgBlue); this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed); this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow); this.addChild(this._blockBgYellow);
centerAnchor(this._block);
centerAnchor(this._blockBgFront);
centerAnchor(this._blockBgBlue);
centerAnchor(this._blockBgRed);
centerAnchor(this._blockBgYellow);
centerAnchor(this.ice);
this.ice.visible = false;
this._block.visible = false; this._block.visible = false;
this._blockBgFront.visible = false; this._blockBgFront.visible = false;
this._blockBgBlue.visible = false; this._blockBgBlue.visible = false;
...@@ -27,8 +39,25 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement ...@@ -27,8 +39,25 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
this.addAni(this._blockBgBlue); this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow); this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed); this.addAni(this._blockBgRed);
this._block.visible = true;
} }
iceCountNum=2;
checkRemoveIce() {
}
resetToBack() {
}
resetToFront() {
}
ice: egret.Bitmap;
private _blockBgYellow: egret.Bitmap; private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap; private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap; private _blockBgBlue: egret.Bitmap;
......
import BlockBase from "./BlockBase"; import BlockBase from "./BlockBase";
import { ElementType } from "../enum/ElementType";
import centerAnchor from "./centerAnchor";
export default class BlockIce extends egret.DisplayObjectContainer implements BlockBase { export default class BlockIce extends egret.DisplayObjectContainer implements BlockBase {
constructor() { constructor() {
...@@ -12,23 +14,39 @@ export default class BlockIce extends egret.DisplayObjectContainer implements B ...@@ -12,23 +14,39 @@ export default class BlockIce extends egret.DisplayObjectContainer implements B
this._blockBgBlue = new egret.Bitmap(RES.getRes('common_block_bg_blue_png')); this._blockBgBlue = new egret.Bitmap(RES.getRes('common_block_bg_blue_png'));
this._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_png')); this._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_png'));
this._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png')); this._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png'));
this.ice = new egret.Bitmap(RES.getRes("ele" + ElementType.ICE + "_png"));
this.ice.alpha = 0.6;
this.addChild(this.ice);
this.addChild(this._block); this.addChild(this._block);
this.addChild(this._blockBgFront); this.addChild(this._blockBgFront);
this.addChild(this._blockBgBlue); this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed); this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow); this.addChild(this._blockBgYellow);
centerAnchor(this._block);
centerAnchor(this._blockBgFront);
centerAnchor(this._blockBgBlue);
centerAnchor(this._blockBgRed);
centerAnchor(this._blockBgYellow);
centerAnchor(this.ice);
this.ice.visible = false;
this._block.visible = false; this._block.visible = false;
this._blockBgFront.visible = false; this._blockBgFront.visible = false;
this._blockBgBlue.visible = false; this._blockBgBlue.visible = false;
this._blockBgRed.visible = false; this._blockBgRed.visible = false;
this._blockBgYellow.visible = false; this._blockBgYellow.visible = false;
this.addAni(this._blockBgBlue); this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow); this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed); this.addAni(this._blockBgRed);
this._block.visible = true;
} }
iceCountNum=1;
ice: egret.Bitmap;
private _blockBgYellow: egret.Bitmap; private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap; private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap; private _blockBgBlue: egret.Bitmap;
......
export default (d: egret.DisplayObject) => {
d.anchorOffsetX = d.width / 2;
d.anchorOffsetY = d.height / 2;
}
\ No newline at end of file
...@@ -23,7 +23,7 @@ export const Chapters2: ChapterData[] = [ ...@@ -23,7 +23,7 @@ export const Chapters2: ChapterData[] = [
starScores: [4000, 8000, 12000], starScores: [4000, 8000, 12000],
map: { map: {
lattices: [ lattices: [
0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 4, 3, 3, 3, 3, 3, 3, 0,
0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0,
0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0,
0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0,
...@@ -34,7 +34,7 @@ export const Chapters2: ChapterData[] = [ ...@@ -34,7 +34,7 @@ export const Chapters2: ChapterData[] = [
1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1,
], ],
elements: [ elements: [
0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1, 1, 1, 0,
0, 2, 1, 1, 1, 1, 1, 2, 0, 0, 2, 1, 1, 1, 1, 1, 2, 0,
0, 2, 1, 1, 1, 1, 1, 2, 0, 0, 2, 1, 1, 1, 1, 1, 2, 0,
0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0,
......
...@@ -15,7 +15,7 @@ export enum ElementConfigType { ...@@ -15,7 +15,7 @@ export enum ElementConfigType {
*/ */
ROCK=2, ROCK=2,
/** /**
* 石头 * 棒棒糖
*/ */
LOLLIPOP=3, LOLLIPOP=3,
/** /**
......
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