Commit 1411ee78 authored by wildfirecode's avatar wildfirecode

1

parent 9f6b9747
......@@ -247,6 +247,12 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync(`inviterulepanel_json`);
}
else {
RES.getResAsync('common_block_bg_yellow_png');
RES.getResAsync('common_block_bg_blue_png');
RES.getResAsync('common_block_bg_red_png');
RES.getResAsync('common_block_png');
RES.getResAsync('common_block_front_png');
RES.getResAsync('mapredbagicom_png');
RES.getResAsync('maplight2_png');
RES.getResAsync('main_mapbottom_png');
......
import getResPath from '../../libs/new_tc/getResPath';
import wait from '../../libs/new_tc/wait';
import Scene from '../../libs/new_wx/components/Scene';
import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl';
import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import { updateMainTimerAfterGetData } from '../../libs/new_wx/MainBase';
import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes';
import { getPropNums } from '../getHomeData';
import { getRedBombTimes } from '../getRedBombAward';
import { getlogItem } from '../Main';
import { getCacheKey, readCache } from '../mapScene/GuideCon';
import PropType from '../PropType';
import { BonusShootAni, stepPosition } from '../something/anis/BonusShootAni';
import { BoomAni } from '../something/anis/BoomAni';
import { CrossAni } from '../something/anis/CrossAni';
import { EggBrokenAni } from '../something/anis/EggBrokenAni';
import { EleDisAni } from '../something/anis/EleDisAni';
import { EleDownAni } from '../something/anis/EleDownAni';
import { EleMaskAni } from '../something/anis/EleMaskAni';
import { FlyTargetAni } from '../something/anis/FlyTargetAni';
import { HairballGreyDisAni } from '../something/anis/HairballGreyDisAni';
import { HorizontalAni } from '../something/anis/HorizontalAni';
import { IceAni } from '../something/anis/IceAni';
import { JellyDisAni } from '../something/anis/JellyDisAni';
import { MagicLionAni } from '../something/anis/MagicLionAni';
import { MagicRotateAni } from '../something/anis/MagicRotateAni';
import { RockAni } from '../something/anis/RockAni';
import { ScoreAni } from '../something/anis/ScoreAni';
import { StepAni } from '../something/anis/StepAni';
import { ThreeCrossAni } from '../something/anis/ThreeCrossAni';
import { VerticalAni } from '../something/anis/VerticalAni';
import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
import { RectsWaveAni } from '../something/anisCall/RectsWaveAni';
import BlockBase, { genBlockDisplay } from '../something/block/BlockBase';
import { getChapterData } from '../something/chapters/getChapter';
import { Element } from '../something/class/Element';
import { Ice } from '../something/class/Ice';
import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType';
import { codeMsgs, ElementType, submitTran, FiveBaseElementTypes } from '../something/enum/ElementType';
import { ElementConfigType } from '../something/enum/ElementConfigType';
import { codeMsgs, ElementType, FiveBaseElementTypes, submitTran } from '../something/enum/ElementType';
import { isIce, isSpecialLattice } from '../something/enum/LatticeType';
import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName';
import { StateType } from '../something/enum/StateType';
import { ChapterData } from '../something/interface/ChapterData';
import { ElementTargetData } from '../something/interface/ElementTargetData';
import { FallAniData, FallType } from '../something/interface/FallAniData';
import { GenerateLatData } from '../something/interface/GenerateLatData';
import { MagicRotateData } from '../something/interface/MagicRotateData';
import { drawBg, drawShape, generateMapBg } from '../something/logic/aaa';
import { AiControl, fesELeSmallNum } from '../something/logic/AiControl';
import { Pool } from '../something/Pool';
import { HairballBlackState } from '../something/states/HairballBlackState';
import { HairballBrownState } from '../something/states/HairballBrownState';
import { Tool } from '../something/Tool';
import { BonusTime } from '../something/uis/BonusTime';
import { ChapterNum } from '../something/uis/ChapterNum';
import { CurScoreNum } from '../something/uis/CurScoreNum';
import { ElementTargets } from '../something/uis/ElementTargets';
import { FestivalTarget } from '../something/uis/FestivalTarget';
import { GameGuide } from '../something/uis/GameGuide';
import { PropBtnCon } from '../something/uis/PropBtnCon';
import { PropGuide } from '../something/uis/PropGuide';
import { ScoreProgress } from '../something/uis/ScoreProgress';
import { StepNumber } from '../something/uis/StepNumber';
......@@ -43,32 +70,6 @@ import { playGameBg, toggleGameBg } from '../soundCtrl2';
import { createData } from '../startScene/StartScene';
import { DataManager } from './../../libs/tw/manager/DataManager';
import { NetManager } from './../../libs/tw/manager/NetManager';
import { readCache, getCacheKey } from '../mapScene/GuideCon';
import { StepAni } from '../something/anis/StepAni';
import { updateMainTimerAfterGetData } from '../../libs/new_wx/MainBase';
import wait from '../../libs/new_tc/wait';
import { AiControl, fesELeSmallNum } from '../something/logic/AiControl';
import { JellyDisAni } from '../something/anis/JellyDisAni';
import { EggBrokenAni } from '../something/anis/EggBrokenAni';
import { FallAniData, FallType } from '../something/interface/FallAniData';
import { EleMaskAni } from '../something/anis/EleMaskAni';
import { getChapterData } from '../something/chapters/getChapter';
import { GenerateLatData } from '../something/interface/GenerateLatData';
import { StateType } from '../something/enum/StateType';
import { HairballBlackState } from '../something/states/HairballBlackState';
import { HairballGreyDisAni } from '../something/anis/HairballGreyDisAni';
import { HairballBrownState } from '../something/states/HairballBrownState';
import { EleDownAni } from '../something/anis/EleDownAni';
import { GameGuide } from '../something/uis/GameGuide';
import { PropBtnCon } from '../something/uis/PropBtnCon';
import { ChapterNum } from '../something/uis/ChapterNum';
import { CurScoreNum } from '../something/uis/CurScoreNum';
import { FestivalTarget } from '../something/uis/FestivalTarget';
import getRedBombAward, { getRedBombTimes } from '../getRedBombAward';
import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
import { RectsWaveAni } from '../something/anisCall/RectsWaveAni';
import { isSpecialLattice } from '../something/enum/LatticeType';
import { ElementConfigType } from '../something/enum/ElementConfigType';
const aniClass = {
"BoomAni": BoomAni,
......@@ -490,19 +491,26 @@ export default class MainScene extends Scene {
} else {
this.lattices[i].reset(i);
}
//冰块
if (isSpecialLattice(latticesD[i])) {
if (isSpecialLattice(latticesD[i])) {//冰块,石门等特殊地图格子配置
let latticeDisplay: egret.DisplayObject;//冰块,石门等的显示对象
var p = Tool.getPositionByIndex(i);
let ice = Pool.takeOut(RecoverName.ICE);
if (!ice) {
ice = new Ice(latticesD[i] - 1);
if (isIce(latticesD[i])) {
let ice = Pool.takeOut(RecoverName.ICE);
if (!ice) {
ice = new Ice(latticesD[i] - 1);
} else {
ice.reset(latticesD[i] - 1);
}
latticeDisplay = ice;
this.lattices[i].ice = ice;
} else {
ice.reset(latticesD[i] - 1);
latticeDisplay = genBlockDisplay(latticesD[i]);
this.lattices[i].block = latticeDisplay;
}
this.map.addChild(ice);
this.lattices[i].ice = ice;
ice.x = p[0];
ice.y = p[1];
this.map.addChild(latticeDisplay);
latticeDisplay.x = p[0];
latticeDisplay.y = p[1];
}
}
//生成口数据
......
import BlockBase from "./BlockBase";
export default class Block extends egret.DisplayObjectContainer implements BlockBase {
constructor() {
super();
this.initUI();
}
initUI() {
this._block = new egret.Bitmap(RES.getRes('common_block_png'));
this._blockBgFront = new egret.Bitmap(RES.getRes('common_block_front_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._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png'));
this.addChild(this._block);
this.addChild(this._blockBgFront);
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow);
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);
}
private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap;
/**
* 未反转过来的背面
*/
private _block: egret.Bitmap;
/**
* 反转过来的正面
*/
private _blockBgFront: egret.Bitmap;
addAni(obj) {
const dur = 1000;
egret.Tween.get(obj, { loop: true }).to({ alpha: 0 }, dur).to({ alpha: 1 }, dur);
}
}
\ No newline at end of file
import { LatticeType } from "../enum/LatticeType";
import Block from "./Block";
import BlockDarkIce from "./BlockDarkIce";
import BlockIce from "./BlockIce";
export const genBlockDisplay = (type: LatticeType) => {
switch (type) {
case LatticeType.BlOCK:
return new Block();
case LatticeType.BLOCK_AND_ICE:
return new BlockIce();
case LatticeType.BLOCK_AND_DARK_ICE:
return new BlockDarkIce();
default:
break;
}
return null
}
export default interface BlockBase {
}
\ No newline at end of file
import BlockBase from "./BlockBase";
export default class BlockDarkIce extends egret.DisplayObjectContainer implements BlockBase{
constructor() {
super();
this.initUI();
}
initUI() {
this._block = new egret.Bitmap(RES.getRes('common_block_png'));
this._blockBgFront = new egret.Bitmap(RES.getRes('common_block_front_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._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png'));
this.addChild(this._block);
this.addChild(this._blockBgFront);
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow);
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);
}
private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap;
/**
* 未反转过来的背面
*/
private _block: egret.Bitmap;
/**
* 反转过来的正面
*/
private _blockBgFront: egret.Bitmap;
addAni(obj) {
const dur = 1000;
egret.Tween.get(obj, { loop: true }).to({ alpha: 0 }, dur).to({ alpha: 1 }, dur);
}
}
\ No newline at end of file
import BlockBase from "./BlockBase";
export default class BlockIce extends egret.DisplayObjectContainer implements BlockBase {
constructor() {
super();
this.initUI();
}
initUI() {
this._block = new egret.Bitmap(RES.getRes('common_block_png'));
this._blockBgFront = new egret.Bitmap(RES.getRes('common_block_front_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._blockBgYellow = new egret.Bitmap(RES.getRes('common_block_bg_yellow_png'));
this.addChild(this._block);
this.addChild(this._blockBgFront);
this.addChild(this._blockBgBlue);
this.addChild(this._blockBgRed);
this.addChild(this._blockBgYellow);
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);
}
private _blockBgYellow: egret.Bitmap;
private _blockBgRed: egret.Bitmap;
private _blockBgBlue: egret.Bitmap;
/**
* 未反转过来的背面
*/
private _block: egret.Bitmap;
/**
* 反转过来的正面
*/
private _blockBgFront: egret.Bitmap;
addAni(obj) {
const dur = 1000;
egret.Tween.get(obj, { loop: true }).to({ alpha: 0 }, dur).to({ alpha: 1 }, dur);
}
}
\ No newline at end of file
import { ElementType } from "../enum/ElementType";
import ILattice from "../lattice/ILattice";
export class Ice extends egret.Bitmap implements ILattice {
export class Ice extends egret.Bitmap {
/**
* 消除次数
*/
......
import { Element } from "./Element";
import { Ice } from "./Ice";
import { Tool } from "../Tool";
import BlockBase from "../block/BlockBase";
/**
* 位置信息直接用一个二维数组记录,然后用row,col取
......@@ -12,6 +13,11 @@ export class Lattice {
* 上面的冰块,是加在背景图上的
*/
ice: Ice;
/**
* 石门,冰石门,深冰石门
*/
block: BlockBase;
/**
* 上面的元素(null,消除元素,石头,冰激凌等),
*/
......@@ -67,6 +73,7 @@ export class Lattice {
this.column = rc[1];
//重置属性,后面自行赋值
this.ice = null;
this.block = null;
this.element = null;
this.up = null;
this.down = null;
......
......@@ -2,13 +2,13 @@
* 地图格子配置,需要和元素格子做区分
*/
export enum LatticeType {
EMPTY=0,
NORMAL=1,
ICE=2,
DARK_ICE=3,
STONE=4, //会持续存在,无法像冰块一样被消除,但是上方可以存在元素。只是展示的时候
STONE_AND_ICE=5,
STONE_AND_DARK_ICE=6
EMPTY = 0,
NORMAL = 1,
ICE = 2,
DARK_ICE = 3,
BlOCK = 4, //会持续存在,无法像冰块一样被消除,但是上方可以存在元素。只是展示的时候
BLOCK_AND_ICE = 5,
BLOCK_AND_DARK_ICE = 6
}
......@@ -19,6 +19,10 @@ export enum LatticeType {
// * 4石门
// * 5石门+浅冰块
// * 6石门+深冰块
export const isSpecialLattice = (type:LatticeType) => {
export const isSpecialLattice = (type: LatticeType) => {
return type != LatticeType.EMPTY && type != LatticeType.NORMAL;
}
export const isIce = (type: LatticeType) => {
return type == LatticeType.ICE || type == LatticeType.DARK_ICE
}
\ 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