Commit 09997e13 authored by zjz1994's avatar zjz1994

草坪暂存

parent 93fd0008
......@@ -127,8 +127,8 @@
// localStorage.clear();
window['imgver'] = '11112';
//top 8 ,repeat 22 , bottom 3
window['total_level'] = 8 + 3 + 22 * 32;
window['last_level'] = 700;
window['total_level'] = 8 + 3 + 22 * 33;
window['last_level'] = 725;
var sharePic = document.getElementById('pic');
sharePic.onclick = function () {
......
......@@ -1128,7 +1128,7 @@ export default class MainScene extends Scene {
latticeDisplay = getSandDisplayBlock();
}
this.lattices[i].sand = latticeDisplay as Sand;
} else if(isGrass(latticesD[i])){//草坪,在石门关闭状态下是否显示
} else if(onlyGrass(latticesD[i])){//单草坪
latticeDisplay = Pool.takeOut(RecoverName.GRASS);
if(!latticeDisplay){
latticeDisplay = new Grass();
......@@ -1137,7 +1137,14 @@ export default class MainScene extends Scene {
}
else {
latticeDisplay = genBlockDisplay(latticesD[i]);
this.lattices[i].block = latticeDisplay as BaseBlock;
let latticeblock = latticeDisplay as BaseBlock;
this.lattices[i].block = latticeblock;
if(isGrass(latticesD[i])){
this.lattices[i].grass = latticeblock.grass;
console.log("石门上的grass",i,this.lattices[i].grass);
}
}
if(latticeDisplay) {
this.mapupContainer.addChild(latticeDisplay);
......@@ -1934,6 +1941,7 @@ export default class MainScene extends Scene {
// }
var grassArr = new Array();
var canturgrass = this.judgeTurfing(index);
console.log("能够蔓延出去",canturgrass);
//新增石头阻挡
var elimitarr = this.getEliPassCannoStone(rc[0],rc[1]);
for(var j=0;j<elimitarr.length;j++){
......@@ -6055,10 +6063,15 @@ export default class MainScene extends Scene {
grassDisplay = new Grass();
}
lat.grass = grassDisplay;
this.mapupContainer.addChild(grassDisplay);
var grasspos = Tool.getPositionByIndex(index);
grassDisplay.x = grasspos[0];
grassDisplay.y = grasspos[1];
if(lat.block){
lat.block.grass = grassDisplay;
lat.block.addChild(grassDisplay);
}else{
this.mapupContainer.addChild(grassDisplay);
var grasspos = Tool.getPositionByIndex(index);
grassDisplay.x = grasspos[0];
grassDisplay.y = grasspos[1];
}
// }
}
}
......
......@@ -71,7 +71,8 @@ const judgeActionIndex = (index: number, lattices: Lattice[],worms:number[][]):
!lattices[i].ice &&
!lattices[i].grass&&
!lattices[i].element.monster &&
!Tool.judgeInWormHole(i,worms)
!Tool.judgeInWormHole(i,worms)&&
!lattices[i].grass
)||
(lattices[i]&&lattices[i].element&&lattices[i].element.inPongoPart)//猩猩支持流沙
) {
......
......@@ -1318,15 +1318,19 @@ export class Tool {
//判断草坪能否铺出去,炮台铺草坪另算
public static judgeTurfing(lat:Lattice){
if(!lat||!lat.element){
console.log("铺出去111111111111");
return false;
}
if(lat.ice&&lat.ice.alpha!=0){
console.log("铺出去222222222222");
return false;
}
if(lat.block && lat.block.ice && lat.block.canIceBroken && lat.block.ice.alpha!=0) {
console.log("铺出去333333333");
return false;
}
if(lat.sand){
console.log("铺出去44444444444");
return false;
}
let ele = lat.element;
......@@ -1337,9 +1341,11 @@ export class Tool {
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)){
return true;
}
console.log("铺出去55555555555555");
return false;
}
if(!lat.grass){
console.log("铺出去66666666666666");
return false;
}
return true;
......
......@@ -2,6 +2,7 @@ import centerAnchor from "./centerAnchor";
import { Element } from "../class/Element";
import { StateType } from "../enum/StateType";
import { LatticeType } from "../enum/LatticeType";
import { Grass } from "../class/Grass";
export default class BaseBlock extends egret.DisplayObjectContainer {
_inited = false;
......@@ -55,6 +56,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
iceCountNum?: number;
ice: egret.Bitmap;
grass:Grass;
/**
* 石门反转了可以消除了
*/
......@@ -103,6 +105,11 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this.ice.scaleX = 0;
egret.Tween.get(this.ice).to({ scaleX: 1 }, dur);
}
if(this.grass){
this.grass.visible = true;
this.grass.scaleX = 0;
egret.Tween.get(this.grass).to({scaleX:1},dur);
}
if (this._element) {
this._element.scaleX = 0;
egret.Tween.get(this._element).to({ scaleX: 1 }, dur);
......@@ -132,6 +139,11 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this.ice.scaleX = 1;
egret.Tween.get(this.ice).to({ scaleX: 0 }, dur);
}
if(this.grass){
this.grass.visible = true;
this.grass.scaleX = 1;
egret.Tween.get(this.grass).to({scaleX:0},dur);
}
if (this._element) {
this._element.scaleX = 1;
egret.Tween.get(this._element).to({ scaleX: 0 }, dur);
......@@ -187,6 +199,10 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this.ice.visible = true;
this.ice.scaleX = 1;
}
if(this.grass){
this.grass.visible = true;
this.grass.scaleX = 1;
}
if(this._element){
this._element.visible = true;
this._element.scaleX = 1;
......
import BaseBlock from "./BaseBlock";
import { Grass } from "../class/Grass";
export default class BlockGrass extends BaseBlock{
initUI(){
super.initUI();
this.grass = new Grass();
this.addChild(this.grass);
this.grass.visible = false;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import BlockDarkIce from "./BlockDarkIce";
import BlockIce from "./BlockIce";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import BlockGrass from "./BlockGrass";
export default (type: LatticeType) => {
const typestr = type + '';
......@@ -61,6 +62,20 @@ export default (type: LatticeType) => {
}
return darkiceblock;
case LatticeType.BLOCK_AND_GRASS:
let grassblock = Pool.takeOut(RecoverName.GRASS_BLOCK);
if(!grassblock){
grassblock = new BlockGrass(_state,LatticeType.BLOCK_AND_GRASS);
}else{
grassblock._state = _state;
grassblock.nextState(true);
}
if(grassblock._state==0||grassblock._state==1||grassblock._state==2){
grassblock.grass.visible = false;
}else{
grassblock.grass.visible = true;
}
return grassblock;
default:
break;
}
......
This diff is collapsed.
......@@ -29,6 +29,7 @@ import { Chapters24 } from "./Chapter24";
import { Chapters25 } from "./Chapter25";
import { Chapters26 } from "./Chapter26";
import { Chapters27 } from "./Chapter27";
import { Chapters28 } from "./Chapter28";
//所有的关卡
const chapters: ChapterData[] = [].concat(
Chapters1,
......@@ -57,7 +58,8 @@ const chapters: ChapterData[] = [].concat(
Chapters24,
Chapters25,
Chapters26,
Chapters27
Chapters27,
Chapters28
)
// console.log(chapters)
chapters.forEach((chapter,index) => {
......@@ -78,7 +80,7 @@ chapters.forEach((chapter,index) => {
*/
export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据
return chapters[676];
return chapters[701];
return chapters[index] || chapters[1];
}
......
......@@ -42,5 +42,5 @@ export const onlyGrass = (type:LatticeType)=>{
return type == LatticeType.GRASS;
}
export const isGrass = (type:LatticeType)=>{
return type== LatticeType.GRASS||type==LatticeType.BLOCK_AND_GRASS;
return type== LatticeType.GRASS||type==LatticeType.BLOCK_AND_GRASS||type==Number(LatticeType.BLOCK_AND_GRASS+"1");
}
\ No newline at end of file
......@@ -92,4 +92,6 @@ export enum RecoverName {
CANNOLIGHT = 'CANNOLIGHT',//炮台聚能
GRASS = 'GRASS',
GRASS_BLOCK = 'GRASS_BLOCK',
}
\ No newline at end of file
......@@ -3513,6 +3513,131 @@
"levelNum": 700,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 701,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 702,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 703,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 704,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 705,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 706,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 707,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 708,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 709,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 710,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 711,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 712,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 713,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 714,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 715,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 716,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 717,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 718,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 719,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 720,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 721,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 722,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 723,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 724,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 725,
"maxScore": 47440,
"stars": 1
}
],
"remainProp": [
......
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