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 = {
|
||||
ejectionPeriod: 80,
|
||||
ejectionPeriod: 5,
|
||||
ambientVelocity: new Vector(0, 0, 0.0),
|
||||
ejectionVelocity: 3,
|
||||
ejectionVelocity: 6,
|
||||
velocityVariance: 0.25,
|
||||
emitterLifetime: 250,
|
||||
emitterLifetime: 50,
|
||||
inheritedVelFactor: 0,
|
||||
particleOptions: {
|
||||
texture: 'particles/star.png',
|
||||
blending: Alpha,
|
||||
texture: 'particles/burst.png',
|
||||
blending: Add,
|
||||
spinSpeed: 90,
|
||||
spinRandomMin: -90,
|
||||
spinRandomMax: 90,
|
||||
lifetime: 500,
|
||||
lifetimeVariance: 100,
|
||||
dragCoefficient: 1,
|
||||
lifetime: 400,
|
||||
lifetimeVariance: 50,
|
||||
dragCoefficient: 0.5,
|
||||
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)],
|
||||
sizes: [0.25, 0.25, 0.25],
|
||||
colors: [
|
||||
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]
|
||||
}
|
||||
};
|
||||
|
|
@ -276,7 +280,7 @@ class Marble extends GameObject {
|
|||
|
||||
this.bounceEmitterData = new ParticleData();
|
||||
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.identifier = "MarbleTrailParticle";
|
||||
|
|
@ -830,7 +834,8 @@ class Marble extends GameObject {
|
|||
|
||||
function bounceEmitter(speed:Float, normal:Vector) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import src.MarbleWorld;
|
|||
|
||||
final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
||||
ejectionPeriod: 10,
|
||||
ambientVelocity: new Vector(0, 0, 0.05),
|
||||
ambientVelocity: new Vector(0, 0, 0),
|
||||
ejectionVelocity: 1,
|
||||
velocityVariance: 0.25,
|
||||
emitterLifetime: 1000,
|
||||
|
|
@ -27,7 +27,11 @@ final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
|||
lifetimeVariance: 150,
|
||||
dragCoefficient: 0.25,
|
||||
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],
|
||||
times: [0, 0.75, 1]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,28 +13,28 @@ import src.MarbleWorld;
|
|||
|
||||
final superSpeedParticleOptions:ParticleEmitterOptions = {
|
||||
ejectionPeriod: 5,
|
||||
ambientVelocity: new Vector(0, 0, 0.2),
|
||||
ambientVelocity: new Vector(0, 0, 0),
|
||||
ejectionVelocity: 1,
|
||||
velocityVariance: 0.25,
|
||||
emitterLifetime: 1100,
|
||||
inheritedVelFactor: 0.25,
|
||||
particleOptions: {
|
||||
texture: 'particles/spark.png',
|
||||
texture: 'particles/smoke.png',
|
||||
blending: Add,
|
||||
spinSpeed: 0,
|
||||
spinRandomMin: 0,
|
||||
spinRandomMax: 0,
|
||||
lifetime: 1500,
|
||||
lifetimeVariance: 150,
|
||||
dragCoefficient: 0.25,
|
||||
lifetimeVariance: 750,
|
||||
dragCoefficient: 4,
|
||||
acceleration: 0,
|
||||
colors: [
|
||||
new Vector(0.8, 0.8, 0, 0),
|
||||
new Vector(0.8, 0.8, 0, 1),
|
||||
new Vector(0.8, 0.8, 0, 0)
|
||||
new Vector(0.42, 0.42, 0.38, 0.1),
|
||||
new Vector(0.34, 0.34, 0.34, 0.1),
|
||||
new Vector(0.30, 0.30, 0.30, 0.1)
|
||||
],
|
||||
sizes: [0.25, 0.25, 1],
|
||||
times: [0, 0.25, 1]
|
||||
sizes: [0.3, 0.7, 1.4],
|
||||
times: [0, 0.5, 1]
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class SuperSpeed extends PowerUp {
|
|||
this.useInstancing = true;
|
||||
ssEmitterParticleData = new ParticleData();
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue