Commit 96e59e0f authored by zjz1994's avatar zjz1994

食物元素暂存

parent 30f717ea
...@@ -9,6 +9,13 @@ export default class Food extends eui.Component{ ...@@ -9,6 +9,13 @@ export default class Food extends eui.Component{
* 44 3*2 * 44 3*2
* 45 1*2 * 45 1*2
*/ */
// 改
/**
* 42 1*2
* 43 3*3
* 44 2*2
* 45 3*2
*/
type:ElementType; type:ElementType;
userow:number; userow:number;
usecol:number; usecol:number;
...@@ -22,8 +29,8 @@ export default class Food extends eui.Component{ ...@@ -22,8 +29,8 @@ export default class Food extends eui.Component{
} }
resetFood(type:ElementType,dir:string,luidx:number){ resetFood(type:ElementType,dir:string,luidx:number){
this.type = type; this.type = type;
this.userow = [3,2,3,1][this.type-ElementType.food1]; this.userow = [1,3,2,3][this.type-ElementType.food1];
this.usecol = [3,2,2,2][this.type-ElementType.food1]; this.usecol = [2,3,2,2][this.type-ElementType.food1];
var texture:egret.Texture = RES.getRes('ele'+type+'_png'); var texture:egret.Texture = RES.getRes('ele'+type+'_png');
this.showImage.texture = texture; this.showImage.texture = texture;
this.showImage.anchorOffsetX = texture.textureWidth/2; this.showImage.anchorOffsetX = texture.textureWidth/2;
......
...@@ -63,10 +63,15 @@ export enum ElementType { ...@@ -63,10 +63,15 @@ export enum ElementType {
Pongo,//40 Pongo,//40
Grass,//41 Grass,//41
food1,//42 蛋糕 food1,//42 雪糕
food2,//43 饼干 food2,//43 蛋糕
food3,//44 寿司 food3,//44 饼干
food4,//45 雪糕 food4,//45 寿司
// food1,//42 蛋糕
// food2,//43 饼干
// food3,//44 寿司
// food4,//45 雪糕
} }
export const isMonsterEle = (t: ElementType) => { export const isMonsterEle = (t: ElementType) => {
......
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