Commit 01a42893 authored by wildfirecode's avatar wildfirecode

update

parent be9bee83
{
"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
...@@ -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
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
...@@ -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
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