Skip to content

Commit

Permalink
Major upgrade to classes and engine
Browse files Browse the repository at this point in the history
  • Loading branch information
roboyeti committed Jan 10, 2023
1 parent d007685 commit 30e4a9b
Show file tree
Hide file tree
Showing 63 changed files with 858 additions and 1,038 deletions.
13 changes: 13 additions & 0 deletions AudioLicenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Audio for these effects come from the following sources:

http://www.freesoundslibrary.com
http://pixabay.com

In some cases, the audio files have been modified and all renamed.

The author(s) of overfx make no claim for the ownership of said files.

Your inclusion of the open source overfx into your web page or application may be required to provide attribution to the above sights.

We are not lawyers and it is you job to determine your requirements.

File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/overfx/snowflake04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Binary file added assets/overfx/winter_wind.mp3
Binary file not shown.
194 changes: 0 additions & 194 deletions fx.js

This file was deleted.

54 changes: 54 additions & 0 deletions fx/boom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class Boom extends OverFxScene {
constructor (config={}) {
super(config);
}

preload() {
this.load.image('particle', 'assets/overfx/muzzleflash3.png');
this.load.audio('boom', ['assets/overfx/explosion.mp3',]);
}

create() {
var x = this.w/2 + getRndInteger(-this.w/4, this.w/4)
var y = this.h/2 + getRndInteger(-this.h/3, this.h/6)

var conf = {
x: x,
y: y,
alpha: { start: 0.7, end: 0 },
scale: { start: 0.1, end: 4.5 },
speed: 100,
angle: { min: -85, max: -95 },
rotate: { min: -180, max: 180 },
lifespan: { min: 1000, max: 1200 },
blendMode: 'SCREEN',
maxParticles: 15,
quantity:1,
tint: 0x222222,
}

for (var i=0;i<3;i++) {
var myp = this.add_emitter('particle',conf);
this.add_emitter(myp,Object.assign(conf,{
scale: { start: 0.5, end: 3.5 },
speed: 50,
accelerationY: 0,
lifespan: { min: 700, max: 900 },
quanitity: 2,
maxParticles: 6,
tint: 0xFFAA44,
}));
this.add_emitter(myp,Object.assign(conf,{
scale: { start: 0.3, end: 2.5 },
speed: 30,
accelerationY: 0,
lifespan: { min: 700, max: 900 },
quanitity: 2,
particleBringToTop: true,
maxParticles: 6,
tint: 0xFFFFFF,
}));
this.audio_play_detune('boom',-1000,1000)
}
}
}
39 changes: 11 additions & 28 deletions fx/chill/chill.js → fx/chill.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
class Chill extends Phaser.Scene {
class Chill extends OverFxScene { //FxScene {
constructor (config={}) {
super(config);
}

preload() {
this.load.image('snow', './fx/chill/snowflake03.png');
// this.load.audio('wind', ['./fx/images/Pop-sound.mp3',]);
this.w = window.innerWidth
this.h = window.innerHeight
this.load.image('snow', 'assets/overfx/snowflake04.png');
this.load.audio('wind', ['assets/overfx/winter_wind.mp3',]);
}

create() {
this.flake1 = this.add.particles('snow');
var SECOND = 1000;
var highWind = {
tween: this.tweens.addCounter({
Expand Down Expand Up @@ -52,39 +49,25 @@ class Chill extends Phaser.Scene {
y: { min: -50, max: -50 }, //this.h/2,
lifespan: 6000,
speed: { min: 100, max: 150},
rotate: {min: -360, max: 360},
scaleX: { start: 0.25, end: 0.01 },
scaleY: { start: 0.3, end: 0.01 },
rotate: {min: -480, max: 480},
scaleX: { start: 0.15, end: 0.01 },
scaleY: { start: 0.2, end: 0.01 },

// scaleX: { min: 0.01, max: 0.02 },
// scaleY: { min: 0.01, max: 0.02 },
// scaleX: { min: 0.01, max: 0.2 },
// scaleY: { min: -1, max: 1 },

alpha: { start: 0.8, end: 0 },
alpha: { start: 1, end: 0 },
gravityY: 100,
blendMode: 'SCREEN',
frequency: 1,
frequency: 2,
// quantity: 10,
// maxParticles: 1200,
tint: [ 0xFFFFFF, 0xDDDDFF, 0xBBBBFF ]
}

this.flake1 = this.add_emitter('snow',conf);
this.flake1.addGravityWell(highWind.processor);
this.flake1.addGravityWell(lowWind.processor);
this.emito = this.flake1.createEmitter(conf);

// var a = this.sound.add('confetti');
// a.detune = getRndInteger(-300,300)
// a.play();
this.audio_play_detune('wind',-300,300)

setTimeout(()=>{
this.emito.stop();
setTimeout( (t)=> {
console.log('Chill cleanup...')
t.flake1.scene.scene.remove();
},6000,this)
},6500)
setTimeout(()=>{ this.stop_emitters() },6500)
}

}
33 changes: 33 additions & 0 deletions fx/confetti.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class Confetti extends OverFxScene {
constructor (config={}) {
super(config);
}

preload() {
this.load.image('confetti', 'assets/overfx/confetti.png');
this.load.audio('confetti', 'assets/overfx/pop.mp3');
}

create() {
var conf = {
x: this.w/2 + getRndInteger(-this.w/10,this.w/10),
y: this.h/3 + getRndInteger(-this.h/8,this.h/8),
speed: { min: 400, max: 800 },
angle: { min: 220, max: 320 },
scaleX: { min: 0.01, max: 0.2 },
scaleY: { min: -1, max: 1 },
rotate: { min: -360, max: 360, ease: 'Back.easeOut' },
lifespan: 3000,
gravityY: 900 ,
maxParticles: 24,
quantity: 3,
tint: [ 0xEE8844, 0xFF3333, 0xDD77DD, 0x8888FF, 0xFF88FF, 0xFFFFFF ],
}

for (var i=0;i<10;i++) {
this.add_emitter('confetti',conf)
}
this.audio_play_detune('confetti',-300,300)
}

}
Binary file removed fx/confetti/Corel Auto-Preserve/confetti5.png
Binary file not shown.
Loading

0 comments on commit 30e4a9b

Please sign in to comment.