mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
particles
This commit is contained in:
parent
d5901ffc24
commit
500022818f
6 changed files with 33 additions and 24 deletions
BIN
data/particles/burst.png
Normal file
BIN
data/particles/burst.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
data/particles/fleck.png
Normal file
BIN
data/particles/fleck.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 568 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.1 KiB |
|
|
@ -78,24 +78,28 @@ enum Mode {
|
||||||
}
|
}
|
||||||
|
|
||||||
final bounceParticleOptions:ParticleEmitterOptions = {
|
final bounceParticleOptions:ParticleEmitterOptions = {
|
||||||
ejectionPeriod: 80,
|
ejectionPeriod: 5,
|
||||||
ambientVelocity: new Vector(0, 0, 0.0),
|
ambientVelocity: new Vector(0, 0, 0.0),
|
||||||
ejectionVelocity: 3,
|
ejectionVelocity: 6,
|
||||||
velocityVariance: 0.25,
|
velocityVariance: 0.25,
|
||||||
emitterLifetime: 250,
|
emitterLifetime: 50,
|
||||||
inheritedVelFactor: 0,
|
inheritedVelFactor: 0,
|
||||||
particleOptions: {
|
particleOptions: {
|
||||||
texture: 'particles/star.png',
|
texture: 'particles/burst.png',
|
||||||
blending: Alpha,
|
blending: Add,
|
||||||
spinSpeed: 90,
|
spinSpeed: 90,
|
||||||
spinRandomMin: -90,
|
spinRandomMin: -90,
|
||||||
spinRandomMax: 90,
|
spinRandomMax: 90,
|
||||||
lifetime: 500,
|
lifetime: 400,
|
||||||
lifetimeVariance: 100,
|
lifetimeVariance: 50,
|
||||||
dragCoefficient: 1,
|
dragCoefficient: 0.5,
|
||||||
acceleration: -2,
|
acceleration: -2,
|
||||||
colors: [new Vector(0.9, 0, 0, 1), new Vector(0.9, 0.9, 0, 1), new Vector(0.9, 0.9, 0, 0)],
|
colors: [
|
||||||
sizes: [0.25, 0.25, 0.25],
|
new Vector(0.5, 0.5, 0.5, 0.3),
|
||||||
|
new Vector(0.3, 0.3, 0.2, 0.1),
|
||||||
|
new Vector(0.2, 0.2, 0.1, 0)
|
||||||
|
],
|
||||||
|
sizes: [0.8, 0.4, 0.2],
|
||||||
times: [0, 0.75, 1]
|
times: [0, 0.75, 1]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -276,7 +280,7 @@ class Marble extends GameObject {
|
||||||
|
|
||||||
this.bounceEmitterData = new ParticleData();
|
this.bounceEmitterData = new ParticleData();
|
||||||
this.bounceEmitterData.identifier = "MarbleBounceParticle";
|
this.bounceEmitterData.identifier = "MarbleBounceParticle";
|
||||||
this.bounceEmitterData.texture = ResourceLoader.getResource("data/particles/star.png", ResourceLoader.getTexture, this.textureResources);
|
this.bounceEmitterData.texture = ResourceLoader.getResource("data/particles/burst.png", ResourceLoader.getTexture, this.textureResources);
|
||||||
|
|
||||||
this.trailEmitterData = new ParticleData();
|
this.trailEmitterData = new ParticleData();
|
||||||
this.trailEmitterData.identifier = "MarbleTrailParticle";
|
this.trailEmitterData.identifier = "MarbleTrailParticle";
|
||||||
|
|
@ -830,7 +834,8 @@ class Marble extends GameObject {
|
||||||
|
|
||||||
function bounceEmitter(speed:Float, normal:Vector) {
|
function bounceEmitter(speed:Float, normal:Vector) {
|
||||||
if (this.bounceEmitDelay == 0 && this._minBounceSpeed <= speed) {
|
if (this.bounceEmitDelay == 0 && this._minBounceSpeed <= speed) {
|
||||||
this.level.particleManager.createEmitter(bounceParticleOptions, this.bounceEmitterData, this.getAbsPos().getPosition());
|
this.level.particleManager.createEmitter(bounceParticleOptions, this.bounceEmitterData,
|
||||||
|
this.getAbsPos().getPosition().sub(normal.multiply(_radius)), null, new Vector(1, 1, 1).add(normal.multiply(-0.8)));
|
||||||
this.bounceEmitDelay = 0.3;
|
this.bounceEmitDelay = 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import src.MarbleWorld;
|
||||||
|
|
||||||
final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
||||||
ejectionPeriod: 10,
|
ejectionPeriod: 10,
|
||||||
ambientVelocity: new Vector(0, 0, 0.05),
|
ambientVelocity: new Vector(0, 0, 0),
|
||||||
ejectionVelocity: 1,
|
ejectionVelocity: 1,
|
||||||
velocityVariance: 0.25,
|
velocityVariance: 0.25,
|
||||||
emitterLifetime: 1000,
|
emitterLifetime: 1000,
|
||||||
|
|
@ -27,7 +27,11 @@ final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
||||||
lifetimeVariance: 150,
|
lifetimeVariance: 150,
|
||||||
dragCoefficient: 0.25,
|
dragCoefficient: 0.25,
|
||||||
acceleration: 0,
|
acceleration: 0,
|
||||||
colors: [new Vector(0, 0.5, 1, 0), new Vector(0, 0.6, 1, 1), new Vector(0, 0.6, 1, 0)],
|
colors: [
|
||||||
|
new Vector(0.38, 0.38, 0.38, 0),
|
||||||
|
new Vector(0.34, 0.34, 0.34, 1),
|
||||||
|
new Vector(0.3, 0.3, 0.3, 0)
|
||||||
|
],
|
||||||
sizes: [0.25, 0.25, 0.5],
|
sizes: [0.25, 0.25, 0.5],
|
||||||
times: [0, 0.75, 1]
|
times: [0, 0.75, 1]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,28 @@ import src.MarbleWorld;
|
||||||
|
|
||||||
final superSpeedParticleOptions:ParticleEmitterOptions = {
|
final superSpeedParticleOptions:ParticleEmitterOptions = {
|
||||||
ejectionPeriod: 5,
|
ejectionPeriod: 5,
|
||||||
ambientVelocity: new Vector(0, 0, 0.2),
|
ambientVelocity: new Vector(0, 0, 0),
|
||||||
ejectionVelocity: 1,
|
ejectionVelocity: 1,
|
||||||
velocityVariance: 0.25,
|
velocityVariance: 0.25,
|
||||||
emitterLifetime: 1100,
|
emitterLifetime: 1100,
|
||||||
inheritedVelFactor: 0.25,
|
inheritedVelFactor: 0.25,
|
||||||
particleOptions: {
|
particleOptions: {
|
||||||
texture: 'particles/spark.png',
|
texture: 'particles/smoke.png',
|
||||||
blending: Add,
|
blending: Add,
|
||||||
spinSpeed: 0,
|
spinSpeed: 0,
|
||||||
spinRandomMin: 0,
|
spinRandomMin: 0,
|
||||||
spinRandomMax: 0,
|
spinRandomMax: 0,
|
||||||
lifetime: 1500,
|
lifetime: 1500,
|
||||||
lifetimeVariance: 150,
|
lifetimeVariance: 750,
|
||||||
dragCoefficient: 0.25,
|
dragCoefficient: 4,
|
||||||
acceleration: 0,
|
acceleration: 0,
|
||||||
colors: [
|
colors: [
|
||||||
new Vector(0.8, 0.8, 0, 0),
|
new Vector(0.42, 0.42, 0.38, 0.1),
|
||||||
new Vector(0.8, 0.8, 0, 1),
|
new Vector(0.34, 0.34, 0.34, 0.1),
|
||||||
new Vector(0.8, 0.8, 0, 0)
|
new Vector(0.30, 0.30, 0.30, 0.1)
|
||||||
],
|
],
|
||||||
sizes: [0.25, 0.25, 1],
|
sizes: [0.3, 0.7, 1.4],
|
||||||
times: [0, 0.25, 1]
|
times: [0, 0.5, 1]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ class SuperSpeed extends PowerUp {
|
||||||
this.useInstancing = true;
|
this.useInstancing = true;
|
||||||
ssEmitterParticleData = new ParticleData();
|
ssEmitterParticleData = new ParticleData();
|
||||||
ssEmitterParticleData.identifier = "superSpeedParticle";
|
ssEmitterParticleData.identifier = "superSpeedParticle";
|
||||||
ssEmitterParticleData.texture = ResourceLoader.getResource("data/particles/spark.png", ResourceLoader.getTexture, this.textureResources);
|
ssEmitterParticleData.texture = ResourceLoader.getResource("data/particles/smoke.png", ResourceLoader.getTexture, this.textureResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function init(level:MarbleWorld, onFinish:Void->Void) {
|
public override function init(level:MarbleWorld, onFinish:Void->Void) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue