Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
01a42893
Commit
01a42893
authored
Nov 21, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
be9bee83
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
4 deletions
+111
-4
newParticle.json
egret/resource/assets/newParticle.json
+51
-0
newParticle.png
egret/resource/assets/newParticle.png
+0
-0
default.res.json
egret/resource/default.res.json
+14
-0
PlayScene.ts
egret/src/playScene/PlayScene.ts
+35
-0
StartScene.ts
egret/src/startScene/StartScene.ts
+11
-4
No files found.
egret/resource/assets/newParticle.json
0 → 100644
View file @
01a42893
{
"texture"
:
"newParticle.png"
,
"rotatePerSecond"
:
30
,
"startBlue"
:
255
,
"startAlpha"
:
0.8901960784313725
,
"rotatePerSecondVariance"
:
10
,
"endSize"
:
10
,
"maxRadius"
:
100
,
"startSize"
:
20
,
"endSizeVariance"
:
5
,
"emitter"
:{
"x"
:
491
,
"y"
:
-28
}
,
"endBlue"
:
255
,
"startRedVariance"
:
0
,
"startBlueVariance"
:
0
,
"emitAngleVariance"
:
360
,
"emitterVariance"
:{
"x"
:
394
,
"y"
:
2
}
,
"startRotation"
:
0
,
"startAlphaVariance"
:
0
,
"startSizeVariance"
:
10
,
"startRotationVariance"
:
45
,
"endAlphaVariance"
:
0
,
"endRotation"
:
263.58
,
"endAlpha"
:
1
,
"engGreenVariance"
:
0
,
"endRotationVariance"
:
292.07
,
"endGreen"
:
255
,
"emitAngle"
:
180
,
"startGreenVariance"
:
0
,
"speedVariance"
:
0
,
"startGreen"
:
255
,
"gravity"
:{
"x"
:
0
,
"y"
:
110
}
,
"speed"
:
20
,
"endRed"
:
255
,
"endRedVariance"
:
0
,
"startRed"
:
255
,
"emitterType"
:
0
,
"blendFactorSource"
:
"one"
,
"maxParticles"
:
200
,
"radialAcceleration"
:
0
,
"blendFactorDestination"
:
"oneMinusSourceAlpha"
,
"radialAccelerationVariance"
:
0
,
"tangentialAcceleration"
:
0
,
"maxRadiusVariance"
:
30
,
"lifespan"
:
2230
,
"tangentialAccelerationVariance"
:
0
,
"minRadius"
:
20
,
"lifespanVariance"
:
700
,
"duration"
:
-1
,
"minRadiusVariance"
:
10
,
"endBlueVariance"
:
0
}
\ No newline at end of file
egret/resource/assets/newParticle.png
0 → 100644
View file @
01a42893
21.3 KB
egret/resource/default.res.json
View file @
01a42893
...
@@ -27,6 +27,10 @@
...
@@ -27,6 +27,10 @@
{
{
"keys"
:
"X_png,ruleBg_png"
,
"keys"
:
"X_png,ruleBg_png"
,
"name"
:
"rule"
"name"
:
"rule"
},
{
"name"
:
"preload"
,
"keys"
:
"newParticle_json,newParticle_png"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -249,6 +253,16 @@
...
@@ -249,6 +253,16 @@
"url"
:
"assets/particle3/firePot.png"
,
"url"
:
"assets/particle3/firePot.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"firePot_png"
"name"
:
"firePot_png"
},
{
"name"
:
"newParticle_json"
,
"type"
:
"json"
,
"url"
:
"assets/newParticle.json"
},
{
"name"
:
"newParticle_png"
,
"type"
:
"image"
,
"url"
:
"assets/newParticle.png"
}
}
]
]
}
}
\ No newline at end of file
egret/src/playScene/PlayScene.ts
View file @
01a42893
import
PlaySceneBase
from
"../../libs/new_wx/components/PlaySceneBase"
;
import
PlaySceneBase
from
"../../libs/new_wx/components/PlaySceneBase"
;
import
{
GravityParticleSystem
}
from
"../../libs/Particle/GravityParticleSystem"
;
export
default
class
PlayScene
extends
PlaySceneBase
{
export
default
class
PlayScene
extends
PlaySceneBase
{
testBtn
:
eui
.
Button
;
testBtn
:
eui
.
Button
;
...
@@ -10,4 +11,38 @@ export default class PlayScene extends PlaySceneBase {
...
@@ -10,4 +11,38 @@ export default class PlayScene extends PlaySceneBase {
this
.
sendSubmit
();
this
.
sendSubmit
();
},
this
)
},
this
)
}
}
system
:
GravityParticleSystem
;
async
start
(
data
?)
{
super
.
start
();
await
Promise
.
all
([
RES
.
getResAsync
(
"newParticle_png"
),
RES
.
getResAsync
(
"newParticle_json"
),
]);
/*** 本示例关键代码段开始 ***/
const
system
=
new
GravityParticleSystem
(
RES
.
getRes
(
"newParticle_png"
),
RES
.
getRes
(
"newParticle_json"
)
);
this
.
addChild
(
system
);
system
.
start
();
system
.
y
=
0
;
system
.
x
=
this
.
stage
.
stageWidth
/
2
;
// system.x = this.stage.stageWidth / 2;
system
.
emitterX
=
0
;
system
.
emitterY
=
0
;
this
.
system
=
system
;
/*** 本示例关键代码段结束 ***/
}
destroy
(){
super
.
destroy
();
this
.
system
.
stop
(
true
)
}
}
}
\ No newline at end of file
egret/src/startScene/StartScene.ts
View file @
01a42893
...
@@ -2,7 +2,7 @@ import StartSceneBase from "../../libs/new_wx/components/StartSceneBase";
...
@@ -2,7 +2,7 @@ import StartSceneBase from "../../libs/new_wx/components/StartSceneBase";
import
{
GravityParticleSystem
}
from
"../../libs/Particle/GravityParticleSystem"
;
import
{
GravityParticleSystem
}
from
"../../libs/Particle/GravityParticleSystem"
;
// tslint:disable
// tslint:disable
export
default
class
StartScene
extends
StartSceneBase
{
export
default
class
StartScene
extends
StartSceneBase
{
system
:
GravityParticleSystem
;
async
start
(
data
?)
{
async
start
(
data
?)
{
super
.
start
();
super
.
start
();
...
@@ -13,7 +13,7 @@ export default class StartScene extends StartSceneBase {
...
@@ -13,7 +13,7 @@ export default class StartScene extends StartSceneBase {
]);
]);
const
bg
=
new
egret
.
Bitmap
();
const
bg
=
new
egret
.
Bitmap
();
bg
.
texture
=
await
RES
.
getRes
(
"firePot_png"
);
bg
.
texture
=
RES
.
getRes
(
"firePot_png"
);
this
.
addChild
(
bg
);
this
.
addChild
(
bg
);
bg
.
x
=
this
.
stage
.
stageWidth
/
2
-
bg
.
width
/
2
-
50
;
bg
.
x
=
this
.
stage
.
stageWidth
/
2
-
bg
.
width
/
2
-
50
;
bg
.
y
=
this
.
stage
.
stageHeight
/
2
-
bg
.
height
/
2
-
210
;
bg
.
y
=
this
.
stage
.
stageHeight
/
2
-
bg
.
height
/
2
-
210
;
...
@@ -22,8 +22,8 @@ export default class StartScene extends StartSceneBase {
...
@@ -22,8 +22,8 @@ export default class StartScene extends StartSceneBase {
/*** 本示例关键代码段开始 ***/
/*** 本示例关键代码段开始 ***/
var
system
=
new
GravityParticleSystem
(
var
system
=
new
GravityParticleSystem
(
await
RES
.
getRes
(
"ballParticle_png"
),
RES
.
getRes
(
"ballParticle_png"
),
await
RES
.
getRes
(
"ballParticle_json"
)
RES
.
getRes
(
"ballParticle_json"
)
);
);
this
.
addChild
(
system
);
this
.
addChild
(
system
);
system
.
start
();
system
.
start
();
...
@@ -35,7 +35,14 @@ export default class StartScene extends StartSceneBase {
...
@@ -35,7 +35,14 @@ export default class StartScene extends StartSceneBase {
bg
.
y
+=
500
;
bg
.
y
+=
500
;
system
.
y
+=
500
;
system
.
y
+=
500
;
this
.
system
=
system
;
/*** 本示例关键代码段结束 ***/
/*** 本示例关键代码段结束 ***/
}
}
destroy
(){
super
.
destroy
();
this
.
system
.
stop
(
true
)
}
}
}
\ No newline at end of file
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