Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
260191a8
Commit
260191a8
authored
Feb 06, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
163b615b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
27 deletions
+103
-27
redbombParticle.png
egret/resource/assets/mainScene/redbombParticle.png
+0
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+2
-2
RedBagAni.ts
egret/src/mapScene/RedBagAni.ts
+1
-1
MagicRotateAni.ts
egret/src/something/anis/MagicRotateAni.ts
+1
-1
FesRedShootAni.ts
egret/src/something/anisCall/FesRedShootAni.ts
+97
-23
AiControl.ts
egret/src/something/logic/AiControl.ts
+2
-0
No files found.
egret/resource/assets/mainScene/redbombParticle.png
View replaced file @
163b615b
View file @
260191a8
496 Bytes
|
W:
|
H:
16.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/src/mainScene/MainScene.ts
View file @
260191a8
...
...
@@ -3125,9 +3125,9 @@ export default class MainScene extends Scene {
},
56
/
60
*
1000
)
}
//时间再调cd
//
setTimeout(() => {
setTimeout
(()
=>
{
callback
();
// }, 8
0)
},
40
0
)
}
/**
...
...
egret/src/mapScene/RedBagAni.ts
View file @
260191a8
...
...
@@ -27,7 +27,7 @@ export default class RedBagAni {
let
iconCount
:
number
=
0
;
export
const
createRedBagIcon
=
(
parent
)
=>
{
// const icon = RES.getRes('mapredbagicom_png'); /// TODO 洒出的图片
const
icon
:
egret
.
Texture
=
RES
.
getRes
(
'chocolate'
+
(
iconCount
++%
4
)
+
"_png"
);
const
icon
:
egret
.
Texture
=
RES
.
getRes
(
'chocolate'
+
(
iconCount
++%
4
)
+
'_png'
);
const
bmp
=
new
egret
.
Bitmap
(
icon
);
bmp
.
anchorOffsetX
=
icon
.
textureWidth
/
2
//32;
bmp
.
anchorOffsetY
=
icon
.
textureHeight
/
2
//33;
...
...
egret/src/something/anis/MagicRotateAni.ts
View file @
260191a8
...
...
@@ -66,7 +66,7 @@ export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObje
* @param rotation 弧度,逆时针
* @param point 定点,默认0,0
*/
function
rotationAcodPoint
(
p
:
number
[],
rotation
:
number
,
point
:
number
[]
=
[
0
,
0
])
{
export
function
rotationAcodPoint
(
p
:
number
[],
rotation
:
number
,
point
:
number
[]
=
[
0
,
0
])
{
//平移
var
xp
=
p
[
0
]
-
point
[
0
];
var
yp
=
p
[
1
]
-
point
[
1
];
...
...
egret/src/something/anisCall/FesRedShootAni.ts
View file @
260191a8
...
...
@@ -5,18 +5,27 @@ import { playSound, SoundType } from "../../soundCtrl";
import
{
Element
}
from
"../class/Element"
;
import
{
Tool
}
from
"../Tool"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
getRotByTwoVectors
,
rotationAcodPoint
}
from
"../anis/MagicRotateAni"
;
let
iconCount
:
number
=
0
;
/**
* 情人节版本
*/
export
class
FesRedShootAni
extends
egret
.
DisplayObjectContainer
{
light
:
LightingAni
;
imageAni
:
ImageAni
;
imageAniCon
:
egret
.
DisplayObjectContainer
imageAniCon
:
egret
.
DisplayObjectContainer
;
//头部
head
:
egret
.
Bitmap
;
constructor
()
{
super
()
this
.
light
=
new
LightingAni
();
this
.
addChild
(
this
.
light
);
var
ht
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
FESTIVALELE_SMALL
+
"_png"
)
this
.
head
=
new
egret
.
Bitmap
(
ht
);
this
.
head
.
anchorOffsetX
=
ht
.
textureWidth
/
2
;
this
.
head
.
anchorOffsetY
=
ht
.
textureHeight
/
2
;
this
.
addChild
(
this
.
head
);
this
.
head
.
scaleX
=
this
.
head
.
scaleY
=
0.3
;
var
arr
=
[]
for
(
var
i
=
1
;
i
<=
10
;
i
++
)
{
arr
.
push
(
"fesEleSmallDis"
+
i
+
"_png"
);
...
...
@@ -28,31 +37,60 @@ export class FesRedShootAni extends egret.DisplayObjectContainer {
this
.
imageAni
.
visible
=
false
}
reset
()
{
this
.
light
.
visible
=
true
;
this
.
head
.
visible
=
true
;
this
.
imageAni
.
visible
=
false
;
this
.
light
.
scaleX
=
0.2
;
}
play
(
startP
:
number
[],
ele
:
Element
,
callback
:
Function
)
{
this
.
reset
()
//算角度
var
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
];
let
head
=
this
.
head
;
let
self
=
this
;
//动画帧出现的地方就是元素的位置
this
.
imageAniCon
.
x
=
ele
.
x
;
this
.
imageAniCon
.
y
=
ele
.
y
;
//247
var
dis
=
Math
.
sqrt
(
(
startP
[
0
]
-
ele
.
x
)
*
(
startP
[
0
]
-
ele
.
x
)
+
(
startP
[
1
]
-
ele
.
y
)
*
(
startP
[
1
]
-
ele
.
y
)
)
var
scaleX
=
dis
/
247
;
egret
.
Tween
.
get
(
this
.
light
)
.
to
({
scaleX
:
scaleX
,
},
400
)
//
var
deltaX
=
startP
[
0
]
-
ele
.
x
;
var
deltaY
=
startP
[
1
]
-
ele
.
y
;
var
dis
=
Math
.
sqrt
(
deltaX
*
deltaX
+
deltaY
*
deltaY
);
//算角度,弧度,x正方向为0,0到2pi,逆时针为正
var
vec0
=
[
1
,
0
]
var
vec1
=
[
deltaX
,
deltaY
]
var
rotation
=
getRotByTwoVectors
(
vec0
,
vec1
);
if
(
deltaY
>
0
)
rotation
=
Math
.
PI
*
2
-
rotation
;
var
tAll
=
60
;
var
a
=
{
t
:
0
};
egret
.
Tween
.
get
(
a
,
{
onChange
:
function
()
{
//螺旋半径,时间t的函数,越来越大,0
var
r
=
dis
*
a
.
t
/
tAll
;
//螺旋角度,基础角度+补间角度,
var
theta
=
a
.
t
/
tAll
*
Math
.
PI
var
x
=
r
*
Math
.
cos
(
theta
)
var
y
=
r
*
Math
.
sin
(
theta
)
//旋转一下
var
xy
=
rotationAcodPoint
([
x
,
y
],
rotation
);
head
.
x
=
xy
[
0
]
+
startP
[
0
];
head
.
y
=
xy
[
1
]
+
startP
[
1
];
//添加尾部粒子
let
p
=
particlePool
.
shift
();
if
(
!
p
)
p
=
new
Particle
();
p
.
reset
();
p
.
x
=
xy
[
0
]
+
startP
[
0
];
p
.
y
=
xy
[
1
]
+
startP
[
1
];
self
.
addChildAt
(
p
,
0
);
}
})
.
to
({
t
:
tAll
},
1200
,
/*egret.Ease.quadIn*/
)
.
call
(()
=>
{
//隐藏头部
head
.
visible
=
false
;
ele
.
reset
(
ElementType
.
FESTIVALELE_SMALL
);
ele
.
scaleX
=
ele
.
scaleY
=
0.1
ele
.
scaleX
=
ele
.
scaleY
=
0.1
;
ele
.
changeSource
(
'chocolate'
+
(
iconCount
++
%
4
)
+
'_png'
)
egret
.
Tween
.
get
(
ele
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
backOut
)
...
...
@@ -66,14 +104,50 @@ export class FesRedShootAni extends egret.DisplayObjectContainer {
};
Pool
.
recover
(
RecoverName
.
FESREDSHOOT_ANI
,
this
)
})
setTimeout
(()
=>
{
this
.
light
.
visible
=
false
;
},
200
)
})
}
}
const
particlePool
:
Particle
[]
=
[];
class
Particle
extends
egret
.
Bitmap
{
private
life
:
number
=
0
;
private
maxLife
:
number
=
60
;
public
alphaSpeed
=
0.02
public
scaleSpeed
=
0.02
;
constructor
()
{
super
();
this
.
texture
=
RES
.
getRes
(
"redbombParticle_png"
);
this
.
anchorOffsetX
=
this
.
texture
.
textureWidth
/
2
;
this
.
anchorOffsetY
=
this
.
texture
.
textureHeight
/
2
;
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
enterFrame
,
this
);
}
reset
()
{
this
.
life
=
0
;
this
.
alpha
=
1
;
// this.scaleX = this.scaleY = 2;
this
.
scaleX
=
this
.
scaleY
=
Math
.
random
()
*
1
;
this
.
rotation
=
Math
.
random
()
*
360
;
}
enterFrame
()
{
// if (!this.stage) return;
if
(
++
this
.
life
>
this
.
maxLife
)
{
//回收
if
(
this
.
parent
)
{
this
.
parent
.
removeChild
(
this
);
particlePool
.
push
(
this
);
}
return
;
}
this
.
alpha
-=
this
.
alphaSpeed
;
if
(
this
.
alpha
<
0
)
this
.
alpha
=
0
// this.scaleX = this.scaleY -= this.scaleSpeed;
// if (this.scaleX < 0) this.scaleX = this.scaleY = 0;
}
}
/**
* 需要回调的
...
...
egret/src/something/logic/AiControl.ts
View file @
260191a8
...
...
@@ -163,6 +163,8 @@ export class AiControl {
for
(
var
i
=
0
;
i
<
six
.
length
;
i
++
)
six
[
i
]
=
six
[
i
].
index
;
//动画
thisObj
.
redBombLightAni
(
index
,
()
=>
{
//巧克力分裂效果,先去掉元素,再加动画
let
count
=
0
;
let
countAll
=
six
.
length
;
for
(
let
a
=
0
;
a
<
six
.
length
;
a
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment