Commit c5825741 authored by wildfirecode's avatar wildfirecode

1

parents 1c4e56c9 c64c4091
...@@ -135,6 +135,9 @@ export default class MainBase extends eui.UILayer { ...@@ -135,6 +135,9 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("ele" + i + j + "_png") RES.getResAsync("ele" + i + j + "_png")
} }
} }
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
for (var i = 1; i <= 12; i++) { for (var i = 1; i <= 12; i++) {
RES.getResAsync("eleDis" + i + "_png") RES.getResAsync("eleDis" + i + "_png")
} }
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
"name": "startpanel" "name": "startpanel"
}, },
{ {
"keys": "yezi1_png,unlightedStar_png,targetBoard_png,stepsBoard_png,stepNumber9_png,stepNumber8_png,stepNumber7_png,stepNumber6_png,stepNumber5_png,stepNumber4_png,stepNumber3_png,stepNumber2_png,stepNumber1_png,stepNumber0_png,stepBtn_png,starProgress_png,setting_png,scoreNumber9_png,scoreNumber8_png,scoreNumber7_png,scoreNumber6_png,scoreNumber5_png,scoreNumber4_png,scoreNumber3_png,scoreNumber2_png,scoreNumber1_png,scoreNumber0_png,rock6_png,rock5_png,rock4_png,rock3_png,rock2_png,rock1_png,rightMark_png,rightArrow_png,rectLat_png,progressDown_png,playSceneBg_png,magicLionBg_png,magicLion_png,lockUp_png,lockDown_png,lineLight_png,lightedStar_png,leftArrow_png,ice6_png,ice5_png,ice4_png,ice3_png,ice2_png,ice1_png,hammerBtn_png,eleDis9_png,eleDis8_png,eleDis7_png,eleDis6_png,eleDis5_png,eleDis4_png,eleDis3_png,eleDis2_png,eleDis12_png,eleDis11_png,eleDis10_png,eleDis1_png,ele5_png,ele42_png,ele41_png,ele40_png,ele4_png,ele32_png,ele31_png,ele30_png,ele3_png,ele22_png,ele21_png,ele20_png,ele2_png,ele12_png,ele11_png,ele10_png,ele1_png,ele02_png,ele01_png,ele00_png,ele0_png,dangqianfenshu_png,chooseRect_png,boomBtn_png,boom9_png,boom8_png,boom7_png,boom6_png,boom5_png,boom4_png,boom3_png,boom2_png,boom18_png,boom17_png,boom16_png,boom15_png,boom14_png,boom13_png,boom12_png,boom11_png,boom10_png,boom1_png,mainSoundBtnOn_png,mainSettingBg_png,mainQuestionBtn_png,mainMusicBtnOn_png,mainQuitBtn_png,mainSoundBtnOff_png,mainMusicBtnOff_png,targetNumber9_png,targetNumber8_png,targetNumber7_png,targetNumber6_png,targetNumber5_png,targetNumber4_png,targetNumber3_png,targetNumber2_png,targetNumber1_png,targetNumber0_png,ele7_png,ele6_png", "keys": "yezi1_png,unlightedStar_png,targetBoard_png,stepsBoard_png,stepNumber9_png,stepNumber8_png,stepNumber7_png,stepNumber6_png,stepNumber5_png,stepNumber4_png,stepNumber3_png,stepNumber2_png,stepNumber1_png,stepNumber0_png,stepBtn_png,starProgress_png,setting_png,scoreNumber9_png,scoreNumber8_png,scoreNumber7_png,scoreNumber6_png,scoreNumber5_png,scoreNumber4_png,scoreNumber3_png,scoreNumber2_png,scoreNumber1_png,scoreNumber0_png,rock6_png,rock5_png,rock4_png,rock3_png,rock2_png,rock1_png,rightMark_png,rightArrow_png,rectLat_png,progressDown_png,playSceneBg_png,magicLionBg_png,magicLion_png,lockUp_png,lockDown_png,lineLight_png,lightedStar_png,leftArrow_png,ice6_png,ice5_png,ice4_png,ice3_png,ice2_png,ice1_png,hammerBtn_png,eleDis9_png,eleDis8_png,eleDis7_png,eleDis6_png,eleDis5_png,eleDis4_png,eleDis3_png,eleDis2_png,eleDis12_png,eleDis11_png,eleDis10_png,eleDis1_png,ele5_png,ele42_png,ele41_png,ele40_png,ele4_png,ele32_png,ele31_png,ele30_png,ele3_png,ele22_png,ele21_png,ele20_png,ele2_png,ele12_png,ele11_png,ele10_png,ele1_png,ele02_png,ele01_png,ele00_png,ele0_png,dangqianfenshu_png,chooseRect_png,boomBtn_png,boom9_png,boom8_png,boom7_png,boom6_png,boom5_png,boom4_png,boom3_png,boom2_png,boom18_png,boom17_png,boom16_png,boom15_png,boom14_png,boom13_png,boom12_png,boom11_png,boom10_png,boom1_png,mainSoundBtnOn_png,mainSettingBg_png,mainQuestionBtn_png,mainMusicBtnOn_png,mainQuitBtn_png,mainSoundBtnOff_png,mainMusicBtnOff_png,targetNumber9_png,targetNumber8_png,targetNumber7_png,targetNumber6_png,targetNumber5_png,targetNumber4_png,targetNumber3_png,targetNumber2_png,targetNumber1_png,targetNumber0_png,ele7_png,ele6_png,bonusFra9_png,bonusFra8_png,bonusFra7_png,bonusFra6_png,bonusFra5_png,bonusFra4_png,bonusFra3_png,bonusFra27_png,bonusFra26_png,bonusFra25_png,bonusFra24_png,bonusFra23_png,bonusFra22_png,bonusFra21_png,bonusFra20_png,bonusFra2_png,bonusFra19_png,bonusFra18_png,bonusFra17_png,bonusFra16_png,bonusFra15_png,bonusFra14_png,bonusFra13_png,bonusFra12_png,bonusFra11_png,bonusFra10_png,bonusFra1_png,bonusShoot_png",
"name": "mainScene" "name": "mainScene"
}, },
{ {
...@@ -1172,14 +1172,144 @@ ...@@ -1172,14 +1172,144 @@
"name": "ele6_png" "name": "ele6_png"
}, },
{ {
"name": "showoff_jpg", "url": "assets/mainScene/bonusFra27.png",
"type": "image", "type": "image",
"url": "assets/showoff.jpg" "name": "bonusFra27_png"
}, },
{ {
"name": "share2_jpg", "url": "assets/mainScene/bonusFra1.png",
"type": "image", "type": "image",
"url": "assets/share2.jpg" "name": "bonusFra1_png"
},
{
"url": "assets/mainScene/bonusFra2.png",
"type": "image",
"name": "bonusFra2_png"
},
{
"url": "assets/mainScene/bonusFra3.png",
"type": "image",
"name": "bonusFra3_png"
},
{
"url": "assets/mainScene/bonusFra4.png",
"type": "image",
"name": "bonusFra4_png"
},
{
"url": "assets/mainScene/bonusFra5.png",
"type": "image",
"name": "bonusFra5_png"
},
{
"url": "assets/mainScene/bonusFra6.png",
"type": "image",
"name": "bonusFra6_png"
},
{
"url": "assets/mainScene/bonusFra7.png",
"type": "image",
"name": "bonusFra7_png"
},
{
"url": "assets/mainScene/bonusFra8.png",
"type": "image",
"name": "bonusFra8_png"
},
{
"url": "assets/mainScene/bonusFra9.png",
"type": "image",
"name": "bonusFra9_png"
},
{
"url": "assets/mainScene/bonusFra10.png",
"type": "image",
"name": "bonusFra10_png"
},
{
"url": "assets/mainScene/bonusFra11.png",
"type": "image",
"name": "bonusFra11_png"
},
{
"url": "assets/mainScene/bonusFra12.png",
"type": "image",
"name": "bonusFra12_png"
},
{
"url": "assets/mainScene/bonusFra13.png",
"type": "image",
"name": "bonusFra13_png"
},
{
"url": "assets/mainScene/bonusFra14.png",
"type": "image",
"name": "bonusFra14_png"
},
{
"url": "assets/mainScene/bonusFra15.png",
"type": "image",
"name": "bonusFra15_png"
},
{
"url": "assets/mainScene/bonusFra16.png",
"type": "image",
"name": "bonusFra16_png"
},
{
"url": "assets/mainScene/bonusFra17.png",
"type": "image",
"name": "bonusFra17_png"
},
{
"url": "assets/mainScene/bonusFra18.png",
"type": "image",
"name": "bonusFra18_png"
},
{
"url": "assets/mainScene/bonusFra19.png",
"type": "image",
"name": "bonusFra19_png"
},
{
"url": "assets/mainScene/bonusFra20.png",
"type": "image",
"name": "bonusFra20_png"
},
{
"url": "assets/mainScene/bonusFra21.png",
"type": "image",
"name": "bonusFra21_png"
},
{
"url": "assets/mainScene/bonusFra22.png",
"type": "image",
"name": "bonusFra22_png"
},
{
"url": "assets/mainScene/bonusFra23.png",
"type": "image",
"name": "bonusFra23_png"
},
{
"url": "assets/mainScene/bonusFra24.png",
"type": "image",
"name": "bonusFra24_png"
},
{
"url": "assets/mainScene/bonusFra25.png",
"type": "image",
"name": "bonusFra25_png"
},
{
"url": "assets/mainScene/bonusFra26.png",
"type": "image",
"name": "bonusFra26_png"
},
{
"url": "assets/mainScene/bonusShoot.png",
"type": "image",
"name": "bonusShoot_png"
} }
] ]
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<e:Button id="hammerBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="hammerBtn_png" skinName="ui.IconButtonSkin" y="1100" x="375.5"/> <e:Button id="hammerBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="hammerBtn_png" skinName="ui.IconButtonSkin" y="1100" x="375.5"/>
<e:Button id="stepBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="stepBtn_png" skinName="ui.IconButtonSkin" y="1100" x="568.46"/> <e:Button id="stepBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="stepBtn_png" skinName="ui.IconButtonSkin" y="1100" x="568.46"/>
<e:Button id="boomBtn" label="" anchorOffsetX="67" anchorOffsetY="60" icon="boomBtn_png" skinName="ui.IconButtonSkin" y="1100" x="185.58"/> <e:Button id="boomBtn" label="" anchorOffsetX="67" anchorOffsetY="60" icon="boomBtn_png" skinName="ui.IconButtonSkin" y="1100" x="185.58"/>
<e:Group id="settingAll" width="89" height="320" x="641" y="53"> <e:Group id="settingAll" width="89" height="203" x="641" y="53" anchorOffsetY="0">
<e:Group id="settingGroup" width="72" height="282" x="8" y="29" anchorOffsetX="0" visible="false"> <e:Group id="settingGroup" width="72" height="282" x="8" y="29" anchorOffsetX="0" visible="false">
<e:Image x="0" y="0" source="mainSettingBg_png"/> <e:Image x="0" y="0" source="mainSettingBg_png"/>
<e:Image id="musicBtn" x="14" y="174" source="mainMusicBtnOn_png"/> <e:Image id="musicBtn" x="14" y="174" source="mainMusicBtnOn_png"/>
......
This diff is collapsed.
...@@ -10,11 +10,11 @@ export const Chapters: ChapterData[] = [ ...@@ -10,11 +10,11 @@ export const Chapters: ChapterData[] = [
map: { map: {
lattices: [ lattices: [
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 3, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 4, 1, 1,
0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 5, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
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,
...@@ -35,9 +35,6 @@ export const Chapters: ChapterData[] = [ ...@@ -35,9 +35,6 @@ export const Chapters: ChapterData[] = [
], ],
connectedLats: [[27, 45], [28, 46], [29, 47]] connectedLats: [[27, 45], [28, 46], [29, 47]]
}, },
iceIndexs: [80],
lollipopCount: 0,
rockIndexs: [54, 75],
baseElementTypes: [0, 1, 2, 3], baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0.15, effectInitProbability: 0.15,
stepCount: 50, stepCount: 50,
...@@ -48,9 +45,17 @@ export const Chapters: ChapterData[] = [ ...@@ -48,9 +45,17 @@ export const Chapters: ChapterData[] = [
passTarget: { passTarget: {
type: PassType.ELEMENT_TARGET, type: PassType.ELEMENT_TARGET,
elements: [ elements: [
// {
// type: ElementType.ICE,
// count: 100,
// },
{
type: ElementType.RABBIT,
count: 56,
},
{ {
type: ElementType.ICE, type: ElementType.LOLLIPOP,
count: 100, count: 4,
} }
], ],
}, },
......
...@@ -211,4 +211,20 @@ export class Tool { ...@@ -211,4 +211,20 @@ export class Tool {
} }
return arr return arr
} }
//算角度,弧度,x正方向为0,0到2pi,顺时针为正
public static getForwardRotation(fromPoint: number[], toPoint: number[]) {
var deltaX = toPoint[0] - fromPoint[0];
var deltaY = toPoint[1] - fromPoint[1];
var vec1 = [1, 0];
var vec2 = [deltaX, deltaY];
var a = Math.sqrt(vec1[0] * vec1[0] + vec1[1] * vec1[1])
var b = Math.sqrt(vec2[0] * vec2[0] + vec2[1] * vec2[1])
var ab = vec1[0] * vec2[0] + vec1[1] * vec2[1]
var cos = ab / (a * b);//反余弦函数范围0到pi
var r = Math.acos(cos);
if (deltaY < 0) {
r = Math.PI * 2 - r;
}
}
} }
\ No newline at end of file
import { ImageAni } from "../class/ImageAni";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
/**
* 需要回调的
* 手动修改this.shoot.rotation=
*/
export class BonusShootAni extends egret.DisplayObjectContainer {
shoot: egret.Bitmap;
imageAni: ImageAni
constructor() {
super()
this.shoot = new egret.Bitmap();
this.shoot.anchorOffsetX = 78;
this.shoot.anchorOffsetY = 37 / 2;
this.addChild(this.shoot);
var arr = []
for (var i = 1; i <= 27; i++) {
arr.push("bonusFra" + i + "_png");
}
this.imageAni = new ImageAni(arr);
this.addChild(this.imageAni);
this.imageAni.visible = false
}
reset() {
this.shoot.visible = true;
this.imageAni.visible = false
}
play(rotation: number, p: number[], callback: Function) {
this.reset()
this.shoot.rotation = rotation;
egret.Tween.get(this)
.to({ x: p[0], y: p[1] }, 1000 + Math.random() * 200 >> 0)
.call(() => {
this.imageAni.play(() => {
if (this.$parent) {
this.$parent.removeChild(this)
};
Pool.recover(RecoverName.BONUSSHOOT_ANI, this)
callback();
})
})
}
}
\ No newline at end of file
import { RecoverName } from "../enum/RecoverName";
import { Pool } from "../Pool";
import { Element } from "../class/Element";
import { Ice } from "../class/Ice";
import { ElementType } from "../enum/ElementType";
export function FlyTargetAni(ele: any, p: number[], con: egret.DisplayObjectContainer) {
//弄一个替代的
let eleC;
if (ele instanceof Element) {
eleC = Pool.takeOut(RecoverName.ELEMENT);
if (!eleC) {
eleC = new Element(ele.type)
} else {
eleC.reset(ele.type)
}
}
//是冰块
else if (ele instanceof Ice) {
eleC = Pool.takeOut(RecoverName.ICE);
if (!eleC) {
eleC = new Ice()
} else {
eleC.reset()
}
}
eleC.x = ele.x;
eleC.y = ele.y;
con.addChild(eleC);
var a = { t: 0 };
egret.Tween.get(eleC)
.to({ x: p[0], y: p[1], scaleX: 0.3, scaleY: 0.3 }, 500 + (Math.random() * 100) >> 0)
.call(() => {
//回收
con.removeChild(eleC);
if (ele instanceof Element) {
Pool.recover(RecoverName.ELEMENT, eleC);
con["elementTargets"].targets[eleC.type].count--
}
//是冰块
else if (ele instanceof Ice) {
Pool.recover(RecoverName.ICE, eleC);
con["elementTargets"].targets[ElementType.ICE].count--
}
// callback()
})
}
\ No newline at end of file
...@@ -29,6 +29,7 @@ export class Ice extends eui.Image { ...@@ -29,6 +29,7 @@ export class Ice extends eui.Image {
reset(n: number = 2){ reset(n: number = 2){
this.scaleX = this.scaleY = 1;
if (n == 2) { if (n == 2) {
this.alpha = 1; this.alpha = 1;
} else { } else {
......
...@@ -12,6 +12,7 @@ export enum RecoverName { ...@@ -12,6 +12,7 @@ export enum RecoverName {
SCORE_ANI = "ScoreAni", SCORE_ANI = "ScoreAni",
BONUSSHOOT_ANI = "BonusShootAni",
//元素身上 //元素身上
LOCK_ANI = "LockAni", LOCK_ANI = "LockAni",
MAGICLIONBG_ANI = "MagicLionBgAni", MAGICLIONBG_ANI = "MagicLionBgAni",
......
...@@ -10,18 +10,6 @@ export interface ChapterData { ...@@ -10,18 +10,6 @@ export interface ChapterData {
* 地图数据 * 地图数据
*/ */
map: MapData; map: MapData;
/**
* 冰块位置索引
*/
iceIndexs?: number[];
/**
* 棒棒糖数量,固定第一排生成
*/
lollipopCount?: number;
/**
* 石头位置索引
*/
rockIndexs?: number[];
/** /**
* 基础元素数量3-5,种类是否随机 * 基础元素数量3-5,种类是否随机
*/ */
......
...@@ -6,7 +6,7 @@ import { PathData } from "./PathData"; ...@@ -6,7 +6,7 @@ import { PathData } from "./PathData";
export interface MapData { export interface MapData {
/** /**
* 一维格子数组,步长9 * 一维格子数组,步长9
* 1为有,0为空 * 0为空,1基本元素,2为浅冰块,3深冰块,4棒棒糖,5石头,6元素枷锁
* 最大9*9长度 * 最大9*9长度
*/ */
lattices: number[]; lattices: number[];
......
...@@ -26,12 +26,13 @@ export class ElementTarget extends egret.DisplayObjectContainer { ...@@ -26,12 +26,13 @@ export class ElementTarget extends egret.DisplayObjectContainer {
return this._count; return this._count;
} }
set count(value: number) { set count(value: number) {
this._count = value; if (value <= 0) {
this.countNum.num = value; value = 0;
if (value == 0) {
this.countNum.visible = false; this.countNum.visible = false;
this.zeroMark.visible = true; this.zeroMark.visible = true;
} }
this._count = value;
this.countNum.num = value;
} }
constructor(type: ElementType) { constructor(type: ElementType) {
super() super()
......
...@@ -27,7 +27,7 @@ export class ElementTargets extends egret.DisplayObjectContainer { ...@@ -27,7 +27,7 @@ export class ElementTargets extends egret.DisplayObjectContainer {
var len = this.$children.length; var len = this.$children.length;
var w = 80 * 0.8; var w = 80 * 0.8;
var space = 25 var space = 25
var right = len / 2 * w - w; var right = len / 2 * w - w + (len - 1) / 2 * space;
for (var i = this.$children.length - 1; i >= 0; i--) { for (var i = this.$children.length - 1; i >= 0; i--) {
this.$children[i].x = right - w * i - space * i; this.$children[i].x = right - w * i - space * i;
} }
......
...@@ -41,6 +41,17 @@ export enum SoundType { ...@@ -41,6 +41,17 @@ export enum SoundType {
good = 'good', good = 'good',
recover = 'recover', recover = 'recover',
shoot = 'shoot', shoot = 'shoot',
fall = 'fall',
magic = 'magic',
boom = 'boom',
sucess = 'sucess',
mapBg = 'mapBg',
eliminate = 'eliminate',
toast = 'toast',
fail = 'fail',
playBg = 'playBg',
line = 'line',
} }
export const playSound = (type: SoundType) => { export const playSound = (type: SoundType) => {
......
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