@@ -4,9 +4,12 @@ window.SuperParticles = window.SuperParticles || class SuperParticles {
4
4
if ( typeof PIXI === 'undefined' ) {
5
5
throw new Error ( "Failed to initialize SuperParticles because Pixi.js was missing!" )
6
6
}
7
- if ( PIXI . VERSION . split ( '.' ) . shift ( ) < 5 ) {
7
+ if ( parseInt ( PIXI . VERSION . split ( '.' ) . shift ( ) ) < 5 ) {
8
8
console . warn ( "Old Pixi.js version detected. Features like FPS limiting won't be available. Switch to a version > 5.0.0-rc if possible." )
9
9
}
10
+ /*else if (PIXI.VERSION === '5.0.0-rc') {
11
+ console.warn("This exact version of Pixi.js (5.0.0-rc) is not supported because of a bug. Use a newer version please.")
12
+ }*/
10
13
this . defaultCfg = {
11
14
useJquery : undefined , // true/false/undefined
12
15
maxFps : 30 , // requires pixi.js v5
@@ -186,7 +189,6 @@ window.SuperParticles = window.SuperParticles || class SuperParticles {
186
189
}
187
190
destroy ( destroyApp = true , removeView = true , stageOptions = true , removeContainer = true , forceRemoveContainer = false , removeResizeListener = true , removeParticles = true ) {
188
191
if ( destroyApp ) {
189
- //debugger
190
192
if ( typeof this . app === 'object' && typeof this . app . destroy === 'function' ) {
191
193
if ( ! removeParticles && typeof this . particles !== 'undefined' ) {
192
194
for ( let particle of this . particles ) {
@@ -199,8 +201,6 @@ window.SuperParticles = window.SuperParticles || class SuperParticles {
199
201
200
202
this . linesLayer = undefined
201
203
if ( removeParticles && typeof this . particles !== 'undefined' ) {
202
- //for (let particle of this.particles) {
203
- //}
204
204
//this.particles = []
205
205
}
206
206
this . debugOverlay = undefined
@@ -240,9 +240,7 @@ window.SuperParticles = window.SuperParticles || class SuperParticles {
240
240
241
241
const particlesToAdd = this . cfg . particles . amount - this . particles . length
242
242
const particlesToRemove = 0 - particlesToAdd
243
- if ( particlesToAdd === 0 ) {
244
- return
245
- }
243
+
246
244
for ( let i = 0 ; i < particlesToAdd ; i ++ ) {
247
245
const randomCoord = this . _getRandomCoord ( )
248
246
const particle = new PIXI . Graphics ( )
@@ -258,8 +256,6 @@ window.SuperParticles = window.SuperParticles || class SuperParticles {
258
256
this . app . stage . removeChild ( this . particles [ 0 ] )
259
257
this . particles . shift ( )
260
258
}
261
- console . log ( `Added ${ particlesToAdd } particles.` )
262
- console . log ( `Removed ${ particlesToRemove } particles.` )
263
259
}
264
260
_createLinesLayer ( ) {
265
261
this . linesLayer = new PIXI . Graphics ( )
0 commit comments