Commit be9bee83 authored by wildfirecode's avatar wildfirecode

update

parent 82b0b9a4
module.exports = {
devPort: 8080,
opn:0
}
\ No newline at end of file
{
// 使用 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
No preview for this file type
...@@ -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
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;
}
}
This diff is collapsed.
// 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;
}
}
This diff is collapsed.
{
"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
{ {
"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
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
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