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
be9bee83
Commit
be9bee83
authored
Nov 21, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
82b0b9a4
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1335 additions
and
2 deletions
+1335
-2
.buildrc.js
.buildrc.js
+4
-0
launch.json
.vscode/launch.json
+15
-0
.DS_Store
egret/.DS_Store
+0
-0
exml.json
egret/.wing/exml.json
+7
-1
GravityParticle.ts
egret/libs/particle/GravityParticle.ts
+27
-0
GravityParticleSystem.ts
egret/libs/particle/GravityParticleSystem.ts
+473
-0
Particle.ts
egret/libs/particle/Particle.ts
+92
-0
ParticleSystem.ts
egret/libs/particle/ParticleSystem.ts
+612
-0
ballParticle.json
egret/resource/assets/particle3/ballParticle.json
+52
-0
ballParticle.png
egret/resource/assets/particle3/ballParticle.png
+0
-0
firePot.png
egret/resource/assets/particle3/firePot.png
+0
-0
default.res.json
egret/resource/default.res.json
+16
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+37
-0
No files found.
.buildrc.js
0 → 100644
View file @
be9bee83
module
.
exports
=
{
devPort
:
8080
,
opn
:
0
}
\ No newline at end of file
.vscode/launch.json
0 → 100644
View file @
be9bee83
{
//
使用
IntelliSense
了解相关属性。
//
悬停以查看现有属性的描述。
//
欲了解更多信息,请访问
:
https
:
//go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"type"
:
"chrome"
,
"request"
:
"launch"
,
"name"
:
"Launch Chrome against localhost"
,
"url"
:
"http://localhost:8080/egret/"
,
"webRoot"
:
"${workspaceFolder}"
}
]
}
\ No newline at end of file
egret/.DS_Store
View file @
be9bee83
No preview for this file type
egret/.wing/exml.json
View file @
be9bee83
...
@@ -41,6 +41,12 @@
...
@@ -41,6 +41,12 @@
"16705cb4eec"
:
{
"16705cb4eec"
:
{
"backgroundType"
:
"user"
,
"backgroundType"
:
"user"
,
"backgroundImage"
:
"/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg"
,
"backgroundImage"
:
"/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg"
,
"backgroundAlpha"
:
100
"backgroundAlpha"
:
100
,
"backgroundX"
:
0
,
"backgroundY"
:
0
,
"backgroundWidth"
:
-1
,
"backgroundHeight"
:
-1
,
"useBgImage"
:
true
,
"useBgColor"
:
true
}
}
}
}
\ No newline at end of file
egret/libs/particle/GravityParticle.ts
0 → 100755
View file @
be9bee83
import
{
Particle
}
from
"./Particle"
;
// tslint:disable
export
class
GravityParticle
extends
Particle
{
public
startX
:
number
;
public
startY
:
number
;
public
velocityX
:
number
;
public
velocityY
:
number
;
public
radialAcceleration
:
number
;
public
tangentialAcceleration
:
number
;
public
rotationDelta
:
number
;
public
scaleDelta
:
number
;
public
alphaDelta
:
number
;
public
reset
():
void
{
super
.
reset
();
this
.
startX
=
0
;
this
.
startY
=
0
;
this
.
velocityX
=
0
;
this
.
velocityY
=
0
;
this
.
radialAcceleration
=
0
;
this
.
tangentialAcceleration
=
0
;
this
.
rotationDelta
=
0
;
this
.
scaleDelta
=
0
;
}
}
egret/libs/particle/GravityParticleSystem.ts
0 → 100755
View file @
be9bee83
This diff is collapsed.
Click to expand it.
egret/libs/particle/Particle.ts
0 → 100755
View file @
be9bee83
// tslint:disable
export
class
Particle
{
/**
* 表示 Particle 实例相对于父级本地坐标的 x 坐标。
* @member {number} particle.Particle#x
*/
public
x
:
number
;
/**
* 表示粒子实例相对于父级本地坐标的 y 坐标。
* @member {number} particle.Particle#y
*/
public
y
:
number
;
/**
* 表示从注册点开始应用的对象的缩放比例(百分比)。
* @member {number} particle.Particle#scale
* @default 1
*/
public
scale
:
number
;
/**
* 表示 Particle 实例距其原始方向的旋转程度,以度为单位
* @member {number} particle.Particle#rotation
* @default 0
*/
public
rotation
:
number
;
/**
* 表示粒子的 Alpha 透明度值
* @member {number} particle.Particle#alpha
* @default 1
*/
public
alpha
:
number
;
/**
* 表示粒子当前存活时间,以毫秒为单位,取值范围(0,Number.MAX_VALUE],该值超过 totalTime 时,粒子将会被销毁
* @member {number} particle.Particle#currentTime
* @default 0
*/
public
currentTime
:
number
;
/**
* 表示粒子的存活总时间,以毫秒为单位,取值范围(0,Number.MAX_VALUE]
* @member {number} particle.Particle#totalTime
* @default 1000
*/
public
totalTime
:
number
;
/**
* 表示粒子的混合模式
* @member {number} particle.Particle#blendMode
*/
public
blendMode
:
number
;
constructor
()
{
this
.
reset
();
}
public
reset
():
void
{
this
.
x
=
0
;
this
.
y
=
0
;
this
.
scale
=
1
;
this
.
rotation
=
0
;
this
.
alpha
=
1
;
this
.
currentTime
=
0
;
this
.
totalTime
=
1000
;
}
private
matrix
:
egret
.
Matrix
=
new
egret
.
Matrix
();
public
$getMatrix
(
regX
:
number
,
regY
:
number
):
egret
.
Matrix
{
var
matrix
=
this
.
matrix
;
matrix
.
identity
();
if
(
this
.
rotation
%
360
)
{
var
r
=
this
.
rotation
;
var
cos
=
egret
.
NumberUtils
.
cos
(
r
);
var
sin
=
egret
.
NumberUtils
.
sin
(
r
);
}
else
{
cos
=
1
;
sin
=
0
;
}
matrix
.
append
(
cos
*
this
.
scale
,
sin
*
this
.
scale
,
-
sin
*
this
.
scale
,
cos
*
this
.
scale
,
this
.
x
,
this
.
y
);
if
(
regX
||
regY
)
{
matrix
.
tx
-=
regX
*
matrix
.
a
+
regY
*
matrix
.
c
;
matrix
.
ty
-=
regX
*
matrix
.
b
+
regY
*
matrix
.
d
;
}
return
matrix
;
}
}
egret/libs/particle/ParticleSystem.ts
0 → 100755
View file @
be9bee83
This diff is collapsed.
Click to expand it.
egret/resource/assets/particle3/ballParticle.json
0 → 100755
View file @
be9bee83
{
"texture"
:
"ballParticle.png"
,
"emitter"
:{
"x"
:
364
,
"y"
:
458
}
,
"engGreenVariance"
:
0
,
"startRotation"
:
-30
,
"startBlue"
:
255
,
"endRedVariance"
:
0
,
"startRotationVariance"
:
0
,
"endRotation"
:
0
,
"startAlphaVariance"
:
0
,
"endSizeVariance"
:
0
,
"endRotationVariance"
:
0
,
"endGreen"
:
255
,
"gravity"
:{
"x"
:
0
,
"y"
:
-150
}
,
"startRedVariance"
:
0
,
"speedVariance"
:
0
,
"endBlue"
:
255
,
"startBlueVariance"
:
0
,
"startAlpha"
:
0.11764705882352941
,
"endRed"
:
255
,
"radialAcceleration"
:
0
,
"endAlpha"
:
1
,
"startRed"
:
255
,
"radialAccelerationVariance"
:
0
,
"duration"
:
-1
,
"tangentialAcceleration"
:
0
,
"maxParticles"
:
300
,
"blendFactorDestination"
:
"oneMinusSourceAlpha"
,
"maxRadius"
:
100
,
"speed"
:
10
,
"maxRadiusVariance"
:
30
,
"lifespan"
:
810
,
"tangentialAccelerationVariance"
:
0
,
"minRadius"
:
20
,
"lifespanVariance"
:
330
,
"minRadiusVariance"
:
10
,
"startSize"
:
50
,
"startGreenVariance"
:
0
,
"rotatePerSecond"
:
30
,
"startSizeVariance"
:
12.88
,
"startGreen"
:
255
,
"rotatePerSecondVariance"
:
10
,
"endSize"
:
15
,
"emitterVariance"
:{
"x"
:
33
,
"y"
:
16
}
,
"endBlueVariance"
:
0
,
"emitterType"
:
0
,
"blendFactorSource"
:
"one"
,
"emitAngle"
:
70
,
"endAlphaVariance"
:
0
,
"emitAngleVariance"
:
360
,
"blendMode"
:
1
}
\ No newline at end of file
egret/resource/assets/particle3/ballParticle.png
0 → 100755
View file @
be9bee83
2.83 KB
egret/resource/assets/particle3/firePot.png
0 → 100755
View file @
be9bee83
7.65 KB
egret/resource/default.res.json
View file @
be9bee83
{
{
"groups"
:
[
"groups"
:
[
{
{
"keys"
:
"optionBtn_png,rankBtn_png,recordbtn_png,ruleBtn_png,start_btn_gray_png,start_btn_png,文案_png,e1_png,e2_png,e3_png,e4_png"
,
"keys"
:
"optionBtn_png,rankBtn_png,recordbtn_png,ruleBtn_png,start_btn_gray_png,start_btn_png,文案_png,e1_png,e2_png,e3_png,e4_png
,firePot_png,ballParticle_png,ballParticle_json
"
,
"name"
:
"start"
"name"
:
"start"
},
},
{
{
...
@@ -234,6 +234,21 @@
...
@@ -234,6 +234,21 @@
"url"
:
"assets/startScene/startscenebg.jpg"
,
"url"
:
"assets/startScene/startscenebg.jpg"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"startscenebg_jpg"
"name"
:
"startscenebg_jpg"
},
{
"url"
:
"assets/particle3/ballParticle.json"
,
"type"
:
"json"
,
"name"
:
"ballParticle_json"
},
{
"url"
:
"assets/particle3/ballParticle.png"
,
"type"
:
"image"
,
"name"
:
"ballParticle_png"
},
{
"url"
:
"assets/particle3/firePot.png"
,
"type"
:
"image"
,
"name"
:
"firePot_png"
}
}
]
]
}
}
\ No newline at end of file
egret/src/startScene/StartScene.ts
View file @
be9bee83
import
StartSceneBase
from
"../../libs/new_wx/components/StartSceneBase"
;
import
StartSceneBase
from
"../../libs/new_wx/components/StartSceneBase"
;
import
{
GravityParticleSystem
}
from
"../../libs/Particle/GravityParticleSystem"
;
// tslint:disable
export
default
class
StartScene
extends
StartSceneBase
{
export
default
class
StartScene
extends
StartSceneBase
{
async
start
(
data
?)
{
super
.
start
();
await
Promise
.
all
([
RES
.
getResAsync
(
"ballParticle_png"
),
RES
.
getResAsync
(
"ballParticle_json"
),
RES
.
getResAsync
(
"firePot_png"
)
]);
const
bg
=
new
egret
.
Bitmap
();
bg
.
texture
=
await
RES
.
getRes
(
"firePot_png"
);
this
.
addChild
(
bg
);
bg
.
x
=
this
.
stage
.
stageWidth
/
2
-
bg
.
width
/
2
-
50
;
bg
.
y
=
this
.
stage
.
stageHeight
/
2
-
bg
.
height
/
2
-
210
;
bg
.
scaleX
=
bg
.
scaleY
=
1.8
;
/*** 本示例关键代码段开始 ***/
var
system
=
new
GravityParticleSystem
(
await
RES
.
getRes
(
"ballParticle_png"
),
await
RES
.
getRes
(
"ballParticle_json"
)
);
this
.
addChild
(
system
);
system
.
start
();
system
.
y
=
this
.
stage
.
stageHeight
/
2
;
system
.
x
=
this
.
stage
.
stageWidth
/
2
;
system
.
emitterX
=
0
;
system
.
emitterY
=
0
;
system
.
scaleX
=
system
.
scaleY
=
1.5
;
bg
.
y
+=
500
;
system
.
y
+=
500
;
/*** 本示例关键代码段结束 ***/
}
}
}
\ 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