Commit c47ff5ff authored by wildfirecode's avatar wildfirecode

1

parent e7d34f26
......@@ -2671,8 +2671,9 @@ export default class MainScene extends Scene {
* @param lat
*/
iceBroken(lat: Lattice) {
if (lat && lat.ice) {
var ice = lat.ice;
if (!lat) return;
if (lat.ice) {//带冰的lattice
const ice = lat.ice;
ice.countNum--;
if (ice.countNum == 0) {
this.map.removeChild(ice);
......@@ -2683,9 +2684,23 @@ export default class MainScene extends Scene {
} else {
ice.alpha = 0.6;
}
var p = Tool.getPositionByIndex(lat.index);
const p = Tool.getPositionByIndex(lat.index);
//动画
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 centerAnchor from "./centerAnchor";
export default class Block extends egret.DisplayObjectContainer implements BlockBase {
export default class Block extends egret.DisplayObjectContainer implements BlockBase {
constructor() {
super();
this.initUI();
......@@ -18,6 +19,12 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow);
centerAnchor(this._block);
centerAnchor(this._blockBgFront);
centerAnchor(this._blockBgBlue);
centerAnchor(this._blockBgRed);
centerAnchor(this._blockBgYellow);
this._block.visible = false;
this._blockBgFront.visible = false;
this._blockBgBlue.visible = false;
......@@ -27,6 +34,8 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed);
this._block.visible = true;
}
private _blockBgYellow: egret.Bitmap;
......
......@@ -19,5 +19,6 @@ export const genBlockDisplay = (type: LatticeType) => {
}
export default interface BlockBase {
iceCountNum:number;
ice:egret.Bitmap;
}
\ No newline at end of file
import BlockBase from "./BlockBase";
export default class BlockDarkIce extends egret.DisplayObjectContainer implements BlockBase{
import { ElementType } from "../enum/ElementType";
import centerAnchor from "./centerAnchor";
export default class BlockDarkIce extends egret.DisplayObjectContainer implements BlockBase {
constructor() {
super();
this.initUI();
......@@ -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._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_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._blockBgFront);
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
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._blockBgFront.visible = false;
this._blockBgBlue.visible = false;
......@@ -27,8 +39,25 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed);
this._block.visible = true;
}
iceCountNum=2;
checkRemoveIce() {
}
resetToBack() {
}
resetToFront() {
}
ice: egret.Bitmap;
private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap;
......
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() {
super();
this.initUI();
......@@ -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._blockBgRed = new egret.Bitmap(RES.getRes('common_block_bg_red_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._blockBgFront);
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
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._blockBgFront.visible = false;
this._blockBgBlue.visible = false;
this._blockBgRed.visible = false;
this._blockBgYellow.visible = false;
this.addAni(this._blockBgBlue);
this.addAni(this._blockBgYellow);
this.addAni(this._blockBgRed);
this._block.visible = true;
}
iceCountNum=1;
ice: egret.Bitmap;
private _blockBgYellow: egret.Bitmap;
private _blockBgRed: 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[] = [
starScores: [4000, 8000, 12000],
map: {
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, 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[] = [
1, 1, 1, 0, 0, 0, 1, 1, 1,
],
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, 2, 2, 2, 2, 2, 2, 0,
......
......@@ -17,7 +17,7 @@ export class Lattice {
/**
* 石门,冰石门,深冰石门
*/
block: BlockBase;
block: BlockBase;
/**
* 上面的元素(null,消除元素,石头,冰激凌等),
*/
......
......@@ -15,7 +15,7 @@ export enum ElementConfigType {
*/
ROCK=2,
/**
* 石头
* 棒棒糖
*/
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