Commit cb13ae72 authored by zjz1994's avatar zjz1994

冰下动物暂存

parent 54294280
...@@ -136,8 +136,8 @@ ...@@ -136,8 +136,8 @@
// localStorage.clear(); // localStorage.clear();
window['imgver'] = '11112'; window['imgver'] = '11112';
//top 8 ,repeat 22 , bottom 3 //top 8 ,repeat 22 , bottom 3
window['total_level'] = 8 + 3 + 22 * 34; window['total_level'] = 8 + 3 + 22 * 35;
window['last_level'] = 750; window['last_level'] = 775;
var sharePic = document.getElementById('pic'); var sharePic = document.getElementById('pic');
sharePic.onclick = function () { sharePic.onclick = function () {
......
...@@ -121,6 +121,7 @@ import Rect = eui.Rect; ...@@ -121,6 +121,7 @@ import Rect = eui.Rect;
import WormHole from '../something/class/WormHole'; import WormHole from '../something/class/WormHole';
import doWormHoleAI from './doWormHoleAI'; import doWormHoleAI from './doWormHoleAI';
import { Grass } from '../something/class/Grass'; import { Grass } from '../something/class/Grass';
import Food from '../something/class/Food';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -254,6 +255,9 @@ export default class MainScene extends Scene { ...@@ -254,6 +255,9 @@ export default class MainScene extends Scene {
wormholeContainer:egret.DisplayObjectContainer; wormholeContainer:egret.DisplayObjectContainer;
//流沙提出来,解决流沙抖动问题 //流沙提出来,解决流沙抖动问题
mapupContainer:egret.DisplayObjectContainer; mapupContainer:egret.DisplayObjectContainer;
//食物层
mapupfoodContainer:egret.DisplayObjectContainer;
//选中框 //选中框
choosed: eui.Image; choosed: eui.Image;
//消除后生成空格的索引 //消除后生成空格的索引
...@@ -479,6 +483,10 @@ export default class MainScene extends Scene { ...@@ -479,6 +483,10 @@ export default class MainScene extends Scene {
//修改流沙的问题 //修改流沙的问题
this.mapupContainer = new egret.DisplayObjectContainer(); this.mapupContainer = new egret.DisplayObjectContainer();
this.addChild(this.mapupContainer); this.addChild(this.mapupContainer);
//食物层
this.mapupfoodContainer = new egret.DisplayObjectContainer();
this.addChild(this.mapupfoodContainer);
this.elementContainer = new egret.DisplayObjectContainer(); this.elementContainer = new egret.DisplayObjectContainer();
this.addChild(this.elementContainer); this.addChild(this.elementContainer);
...@@ -532,6 +540,7 @@ export default class MainScene extends Scene { ...@@ -532,6 +540,7 @@ export default class MainScene extends Scene {
this.mapContainer.removeChildren(); this.mapContainer.removeChildren();
this.mapupContainer.removeChildren(); this.mapupContainer.removeChildren();
this.mapupfoodContainer.removeChildren();
this.elementContainer.removeChildren(); this.elementContainer.removeChildren();
this.effectContainer.removeChildren(); this.effectContainer.removeChildren();
this.guideContainer.removeChildren(); this.guideContainer.removeChildren();
...@@ -571,6 +580,8 @@ export default class MainScene extends Scene { ...@@ -571,6 +580,8 @@ export default class MainScene extends Scene {
this.initWormHole(); this.initWormHole();
//有草坪,加塞草坪的动画 //有草坪,加塞草坪的动画
this.initLawn(); this.initLawn();
//食物在冰下,草上
this.initFoods()
//初始话地图格子数据 //初始话地图格子数据
this.initLattices(); this.initLattices();
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map //初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
...@@ -1157,6 +1168,22 @@ export default class MainScene extends Scene { ...@@ -1157,6 +1168,22 @@ export default class MainScene extends Scene {
this.initWormSvgas(); this.initWormSvgas();
} }
} }
//食物
initFoods(){
var foodsdata = this.chapterData.map.foodsdata;
for(var i=0;i<foodsdata.length;i++){
var ifood = foodsdata[i];
var ifoodtype = ifood.type;
var ifoodidx = ifood.luidx;
var ifoodir = ifood.dir;
var ifood1 = new Food(ifoodtype);
var ipos = ifood1.resetFood(ifoodir,ifoodidx);
ifood1.x = ipos[0];
ifood1.y = ipos[1];
this.mapupfoodContainer.addChild(ifood1);
console.log("食物处理",ifoodtype);
}
}
//初始化地图格子数据,包括生成口,联通口,次数,新加入reCoverAllLattice----LATTICE回收 //初始化地图格子数据,包括生成口,联通口,次数,新加入reCoverAllLattice----LATTICE回收
initLattices() { initLattices() {
......
This diff is collapsed.
import { ChapterData } from "../interface/ChapterData";
//751-775
export const Chapters30: ChapterData[] = [
{
baseElementTypes: [ 0, 1, 2, 3 ], bubbleProbability: 0, stepCount: 24,
passTarget: { type: 1,
elements: [
{ type: 34, count: 20 },
{ type: 36, count: 60 },
{ type: 0, count: 115 }
] },
starScores: [ 15000, 20000, 25000 ],
map: {
lattices: [
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1
], connectedLats: [], conveyor: [], conveyorConnectedLats: [],
WORMHOLE: [],
foodsdata:[
{
type:42,
luidx:23,
dir:"up"
},
{
type:43,
luidx:3,
dir:'left'
},
{
type:44,
luidx:56,
dir:'left'
},
{
type:45,
luidx:37,
dir:'left'
},
],
elements: [
4, 1, 1, 1, 1, 1, 1, 1, 4,
4, 4, 1, 1, 1, 1, 1, 4, 4,
4, 4, 1, 1, 1, 1, 1, 4, 4,
2, 16, 2, 16, 2, 16, 2, 16, 2,
2, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 1, 1, 1, 1, 1, 2, 2,
1, 2, 2, 1, 1, 1, 2, 2, 1,
1, 1, 2, 2, 2, 2, 2, 1, 1,
1, 1, 1, 2, 2, 2, 1, 1, 1
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
], recycles: [],
generateLats: [
{ index: 0, type: null }, { index: 1, type: null },
{ index: 2, type: null }, { index: 3, type: null },
{ index: 4, type: null }, { index: 5, type: null },
{ index: 6, type: null }, { index: 7, type: null },
{ index: 8, type: null } ] }
}
]
...@@ -31,6 +31,7 @@ import { Chapters26 } from "./Chapter26"; ...@@ -31,6 +31,7 @@ import { Chapters26 } from "./Chapter26";
import { Chapters27 } from "./Chapter27"; import { Chapters27 } from "./Chapter27";
import { Chapters28 } from "./Chapter28"; import { Chapters28 } from "./Chapter28";
import { Chapters29 } from "./Chapter29"; import { Chapters29 } from "./Chapter29";
import { Chapters30 } from "./Chapter30";
//所有的关卡 //所有的关卡
const chapters: ChapterData[] = [].concat( const chapters: ChapterData[] = [].concat(
Chapters1, Chapters1,
...@@ -61,7 +62,9 @@ const chapters: ChapterData[] = [].concat( ...@@ -61,7 +62,9 @@ const chapters: ChapterData[] = [].concat(
Chapters26, Chapters26,
Chapters27, Chapters27,
Chapters28, Chapters28,
Chapters29 Chapters29,
Chapters30,
) )
// console.log(chapters) // console.log(chapters)
chapters.forEach((chapter,index) => { chapters.forEach((chapter,index) => {
...@@ -82,7 +85,7 @@ chapters.forEach((chapter,index) => { ...@@ -82,7 +85,7 @@ chapters.forEach((chapter,index) => {
*/ */
export function getChapterData(index: number): ChapterData { export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据 //没有数据就返回第一关数据
// return chapters[701]; return chapters[751];
return chapters[index] || chapters[1]; return chapters[index] || chapters[1];
} }
......
...@@ -1000,7 +1000,7 @@ export class Element extends eui.Component { ...@@ -1000,7 +1000,7 @@ export class Element extends eui.Component {
} }
/** /**
* 会重置掉所有特效类型,枷锁,鸡蛋等 * 会重置掉所有特效类型,枷锁,鸡蛋等
* @param type 只应该是基础元素和特殊元素 * @param type 只应该是基础元素和特殊元素
*/ */
reset(type: ElementType) { reset(type: ElementType) {
......
import { ElementType } from "../enum/ElementType";
import { Tool } from "../Tool";
export default class Food extends eui.Component{
showImage:eui.Image;
/**
* 42 3*3
* 43 2*2
* 44 3*2
* 45 1*2
*/
type:ElementType;
userow:number;
usecol:number;
constructor(type:ElementType){
super();
this.type = type;
this.userow = [3,2,3,1][this.type-ElementType.food1];
this.usecol = [3,2,2,2][this.type-ElementType.food1];
this.showImage = new eui.Image();
this.addChild(this.showImage);
var texture:egret.Texture = RES.getRes('ele'+type+'_png');
this.showImage.texture = texture;
this.showImage.anchorOffsetX = texture.textureWidth/2;
this.showImage.anchorOffsetY = texture.textureHeight/2;
}
resetFood(dir:string,luidx:number){
var roa:number;
var inidx:number = 0;
if(dir=='left'){
roa = -90;
inidx = 1
}else if(dir=='up'){
roa = 0;
inidx = 0;
}else if(dir=='right'){
roa = 90;
inidx = 1;
}else if(dir=='down'){
roa = 180;
inidx = 0;
}
var irow:number = [this.userow,this.usecol][inidx];
var icol:number = [this.usecol,this.userow][inidx];
this.showImage.rotation = roa;
var onelength = 78;
var posx = Tool.getPositionByIndex(luidx)[0]+irow*onelength/2;
var posy = Tool.getPositionByIndex(luidx)[1]+icol*onelength/2;
return [posx,posy];
}
}
\ No newline at end of file
...@@ -63,7 +63,10 @@ export enum ElementType { ...@@ -63,7 +63,10 @@ export enum ElementType {
Pongo,//40 Pongo,//40
Grass,//41 Grass,//41
food1,//42 蛋糕
food2,//43 饼干
food3,//44 寿司
food4,//45 雪糕
} }
export const isMonsterEle = (t: ElementType) => { export const isMonsterEle = (t: ElementType) => {
......
...@@ -74,4 +74,12 @@ export interface MapData { ...@@ -74,4 +74,12 @@ export interface MapData {
* 黑洞 * 黑洞
*/ */
WORMHOLE?:number[][]; WORMHOLE?:number[][];
/**
* 冰下食物
*/
foodsdata?:Array<{
type:number,//类型
luidx:number,//左上位置
dir:string,//朝向
}>;
} }
\ No newline at end of file
...@@ -3763,6 +3763,131 @@ ...@@ -3763,6 +3763,131 @@
"levelNum": 750, "levelNum": 750,
"maxScore": 47440, "maxScore": 47440,
"stars": 1 "stars": 1
},
{
"levelNum": 751,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 752,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 753,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 754,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 755,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 756,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 757,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 758,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 759,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 760,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 761,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 762,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 763,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 764,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 765,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 766,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 767,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 768,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 769,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 770,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 771,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 772,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 773,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 774,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 775,
"maxScore": 47440,
"stars": 1
} }
], ],
"remainProp": [ "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