Commit 619d7f3d authored by haiyoucuv's avatar haiyoucuv

节日红包fa

parent 178aa111
......@@ -3,16 +3,10 @@
<component name="ChangeListManager">
<list default="true" id="9cef0552-af3c-4a1c-be1f-dc41ebe5b6db" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/festival/fesRedBombSta1.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/festival/fesRedBombSta1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/festival/fesRedDown.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/festival/fesRedDown.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/festival/xingxingbi.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/res.json" beforeDir="false" afterPath="$PROJECT_DIR$/resource/res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ResJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/ResJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/anisCall/FesRedBombShowAni.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/anisCall/FesRedBombShowAni.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/anisCall/DoorChangeAni.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/anisCall/DoorChangeAni.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/anisCall/FesRedShootAni.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/anisCall/FesRedShootAni.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/anisCall/RectsWaveAni.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/anisCall/RectsWaveAni.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/class/FestivalEle.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/class/FestivalEle.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/something/logic/AiControl.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/logic/AiControl.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -157,14 +151,7 @@
<workItem from="1600912046696" duration="16271000" />
<workItem from="1600998191749" duration="23862000" />
<workItem from="1601170975973" duration="20963000" />
<workItem from="1601257315718" duration="38835000" />
</task>
<task id="LOCAL-00010" summary="map effect">
<created>1594697145788</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1594697145788</updated>
<workItem from="1601257315718" duration="39089000" />
</task>
<task id="LOCAL-00011" summary="map effect">
<created>1594698378321</created>
......@@ -502,7 +489,14 @@
<option name="project" value="LOCAL" />
<updated>1601351573277</updated>
</task>
<option name="localTasksCounter" value="59" />
<task id="LOCAL-00059" summary="节日红包">
<created>1601363028904</created>
<option name="number" value="00059" />
<option name="presentableId" value="LOCAL-00059" />
<option name="project" value="LOCAL" />
<updated>1601363028904</updated>
</task>
<option name="localTasksCounter" value="60" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -531,7 +525,8 @@
<MESSAGE value="换了点皮,换了下接口" />
<MESSAGE value="主页" />
<MESSAGE value="afdjk,asfhksjkdulfh klasoi;dfbhjkgv kl;" />
<option name="LAST_COMMIT_MESSAGE" value="afdjk,asfhksjkdulfh klasoi;dfbhjkgv kl;" />
<MESSAGE value="节日红包" />
<option name="LAST_COMMIT_MESSAGE" value="节日红包" />
</component>
<component name="WindowStateProjectService">
<state x="440" y="273" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1595229546530">
......@@ -546,10 +541,10 @@
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="251" y="471" key="ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/31.23.1889.1177@31.23.1889.1177" timestamp="1594113080922" />
<state x="557" y="183" width="884" height="891" key="CommitChangelistDialog2" timestamp="1601351572471">
<state x="557" y="183" width="884" height="891" key="CommitChangelistDialog2" timestamp="1601363028558">
<screen x="30" y="23" width="1890" height="1177" />
</state>
<state x="557" y="183" key="CommitChangelistDialog2/30.23.1890.1177@30.23.1890.1177" timestamp="1601351572471" />
<state x="557" y="183" key="CommitChangelistDialog2/30.23.1890.1177@30.23.1890.1177" timestamp="1601363028558" />
<state x="558" y="183" width="884" height="891" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1595584297912" />
<state x="131" y="123" width="730" height="977" key="DiffContextDialog" timestamp="1596165868169">
<screen x="30" y="23" width="1890" height="1177" />
......@@ -605,10 +600,10 @@
</state>
<state x="289" y="314" key="SettingsEditor/30.23.1890.1177@30.23.1890.1177" timestamp="1596079390860" />
<state x="300" y="248" key="SettingsEditor/31.23.1889.1177@31.23.1889.1177" timestamp="1594798992724" />
<state x="91" y="351" key="Vcs.Push.Dialog.v2" timestamp="1601351574473">
<state x="91" y="351" key="Vcs.Push.Dialog.v2" timestamp="1601363030470">
<screen x="30" y="23" width="1890" height="1177" />
</state>
<state x="91" y="351" key="Vcs.Push.Dialog.v2/30.23.1890.1177@30.23.1890.1177" timestamp="1601351574473" />
<state x="91" y="351" key="Vcs.Push.Dialog.v2/30.23.1890.1177@30.23.1890.1177" timestamp="1601363030470" />
<state x="92" y="351" key="Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177" timestamp="1595584299423" />
<state x="87" y="216" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1594705166397">
<screen x="31" y="23" width="1889" height="1177" />
......
......@@ -24,17 +24,17 @@ export class DoorChangeAni extends FYGE.Container {
ele: Element;
constructor(lat: Lattice) {
super();
var door: Door = lat.door;
const door: Door = lat.door;
//应该不会出现door不存在的情况
if (!door) { }
//
var textureBg: FYGE.Texture = RES.getRes(doorBgImages[door.statusNum]);
const textureBg: FYGE.Texture = RES.getRes(doorBgImages[door.statusNum]);
this.doorBg = new FYGE.Sprite(textureBg);
this.doorBg.x = - textureBg.width / 2;
this.doorBg.y = - textureBg.height / 2;
this.addChild(this.doorBg);
//
var textureDoor: FYGE.Texture = RES.getRes(doorImages[door.closed ? 0 : 1]);
const textureDoor: FYGE.Texture = RES.getRes(doorImages[door.closed ? 0 : 1]);
this.door = new FYGE.Sprite(textureDoor);
this.door.x = - textureDoor.width / 2;
this.door.y = - textureDoor.height / 2;
......@@ -58,27 +58,27 @@ export class DoorChangeAni extends FYGE.Container {
//最终状态
let isClosed = lat.door.closed;
this.reset(lat);
var p = Tool.getPositionByIndex(lat.index)
const p = Tool.getPositionByIndex(lat.index);
//位置
this.x = p[0];
this.y = p[1];
if (this.ice) this.ice.visible = isClosed ? false : true;
if (this.ele) this.ele.visible = isClosed ? false : true;
if (this.ice) this.ice.visible = !isClosed;
if (this.ele) this.ele.visible = !isClosed;
FYGE.Tween.get(this)
.to({ scaleX: 0 }, 300)
.call(() => {
//修改门图
this.door.texture = RES.getRes(doorImages[isClosed ? 1 : 0]);
//元素透明度修改
if (this.ice) this.ice.visible = isClosed ? true : false;
if (this.ele) this.ele.visible = isClosed ? true : false;
if (this.ice) this.ice.visible = isClosed;
if (this.ele) this.ele.visible = isClosed;
FYGE.Tween.get(this)
.to({ scaleX: 1 }, 300)
.call(() => {
callback();
if (this.parent) {
this.parent.removeChild(this)
};
}
Pool.recover(RecoverName.DOORCHANGE_ANI, this)
})
})
......@@ -93,7 +93,7 @@ export class DoorChangeAni extends FYGE.Container {
if (ice) {
//原先没有就加上
if (!this.ice) {
var textureIce: FYGE.Texture = RES.getRes("ele" + ElementType.ICE + ".png");
const textureIce: FYGE.Texture = RES.getRes("ele" + ElementType.ICE + ".png");
this.ice = new FYGE.Sprite(textureIce);
this.ice.x = - textureIce.width / 2;
this.ice.y = -textureIce.height / 2;
......@@ -126,4 +126,4 @@ export class DoorChangeAni extends FYGE.Container {
this.ele = null;
}
}
}
\ No newline at end of file
}
......@@ -6,7 +6,6 @@ import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
import { RES } from "../../../module/RES";
import Texture = FYGE.Texture;
import FrameAni = FYGE.FrameAni;
/**
* 需要回调的
......@@ -22,8 +21,8 @@ export class FesRedShootAni extends FYGE.Container {
this.light = new LightingAni();
this.addChild(this.light);
var arr = []
for (var i = 1; i <= 10; i++) {
const arr = [];
for (let i = 1; i <= 10; i++) {
arr.push(RES.getRes("fesEleSmallDis" + i + ".png"));
}
this.imageAniCon = new FYGE.Container();
......@@ -45,18 +44,18 @@ export class FesRedShootAni extends FYGE.Container {
this.light.visible = true;
//算角度
var r = Tool.getForwardRotation(startP, [ele.x, ele.y])
const r = Tool.getForwardRotation(startP, [ele.x, ele.y]);
this.light.rotation = r * 180 / Math.PI;
this.light.x = startP[0];
this.light.y = startP[1];
this.imageAniCon.x = ele.x;
this.imageAniCon.y = ele.y;
//247
var dis = Math.sqrt(
const dis = Math.sqrt(
(startP[0] - ele.x) * (startP[0] - ele.x) +
(startP[1] - ele.y) * (startP[1] - ele.y)
)
var scaleX = dis / 247;
);
const scaleX = dis / 247;
FYGE.Tween.get(this.light)
.to({scaleX: scaleX,}, 400)
.call(() => {
......@@ -73,7 +72,6 @@ export class FesRedShootAni extends FYGE.Container {
if (this.parent) {
this.parent.removeChild(this)
}
;
Pool.recover(RecoverName.FESREDSHOOT_ANI, this)
})
setTimeout(() => {
......@@ -102,8 +100,8 @@ class LightingAni extends FYGE.Sprite {
*/
constructor() {
super();
var arr = [];
for (var i = 1; i <= 13; i++) {
const arr = [];
for (let i = 1; i <= 13; i++) {
arr.push(RES.getRes("lineLight" + i + ".png"))
}
this.anchorTexture.set(23 / 293, 27 / 58)
......@@ -122,9 +120,9 @@ class LightingAni extends FYGE.Sprite {
onEnterFrame() {
if (!this.stage) return
var dataNow = Date.now();
var deltaTime = dataNow - this.startTime;
var scale = deltaTime / this.allTime;
const dataNow = Date.now();
const deltaTime = dataNow - this.startTime;
const scale = deltaTime / this.allTime;
if (scale >= 1) {
this.startTime = Date.now()
this.currentFrame = 0;
......
......@@ -6,9 +6,10 @@ import { RES } from "../../../module/RES";
const whiteRectPool: WhiteRect[] = []
/**
* 格子波纹的动画
* @param lattices
* @param container
* @param callback
* @param lattices
* @param container
* @param callback
* @param centerIndex
*/
export function RectsWaveAni(
lattices: Lattice[],
......@@ -16,15 +17,15 @@ export function RectsWaveAni(
callback?: Function,
centerIndex: number = 40,
) {
var loops: WhiteRect[][] = [];
var rc = Tool.indexToRc(centerIndex);
const loops: WhiteRect[][] = [];
const rc = Tool.indexToRc(centerIndex);
//格子间距 0到最大的格子
var num = 0;
var maxNum = Math.max(rc[0], rc[1], Tool.rowNum - rc[0] - 1, Tool.colNum - rc[1] - 1)
let num = 0;
const maxNum = Math.max(rc[0], rc[1], Tool.rowNum - rc[0] - 1, Tool.colNum - rc[1] - 1);
//所有格子都填上
while (num <= maxNum) {
//每一圈所有格子索引
var indexs: number[] = [];
const indexs: number[] = [];
if (num) {
......@@ -79,7 +80,7 @@ export function RectsWaveAni(
//根据索引
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var p = Tool.getPositionByIndex(index);
const p = Tool.getPositionByIndex(index);
let rect = whiteRectPool.shift();
if (!rect) rect = new WhiteRect();
rect.alpha = 0;
......@@ -129,8 +130,7 @@ export function RectsWaveAni(
class WhiteRect extends FYGE.Sprite {
constructor() {
super();
var texture: FYGE.Texture = RES.getRes("rectLatWhite.png");
this.texture = texture;
this.texture = RES.getRes("rectLatWhite.png");
this.anchorTexture.set(0.5, 0.5);
// this.anchorOffsetX = texture.textureWidth / 2;
// this.anchorOffsetY = texture.textureHeight / 2;
......@@ -139,9 +139,9 @@ class WhiteRect extends FYGE.Sprite {
function rangeIndexs(min: number, max: number, include: boolean = true) {
var nums = [];
const nums = [];
if (include) nums.push(min);
var num: number = min;
let num: number = min;
while (++num < max) nums.push(num);
if (include) nums.push(max);
return nums
......
import { ElementType } from "../enum/ElementType";
import { RES } from "../../../module/RES";
import { Tools } from "../../Tools";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Texture = FYGE.Texture;
import FrameAni = FYGE.FrameAni;
import { Tool } from "../Tool";
/**
* 节日元素
......@@ -46,12 +44,9 @@ export class FestivalEle extends FYGE.Container {
constructor(n: number = 2) {
super();
var status3 = new Status3();
this.addChild(status3);
var status2 = new Status2();
this.addChild(status2);
var status1 = new Status1();
this.addChild(status1);
this.addChild(new Status3());
this.addChild(new Status2());
this.addChild(new Status1());
this.toggleStatus(n);
this.isActive = false;
......@@ -66,8 +61,8 @@ export class FestivalEle extends FYGE.Container {
}
toggleStatus(index: number) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
for (let i = 0; i < this.children.length; i++) {
const child = this.children[i];
if (i == index) {
child.visible = true;
//重置状态
......
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