• Content Count

  • Joined

  • Last visited

Everything posted by codart

  1. Hi! I know exactly where the leak happen. You can open the sandbox, my app run within it. Please pick a mp3 file then see the effect as below: This is the snippet of code which I pretty sure cause the memory leak: onTick(delta) { const data =; const { center, radius, inscrement } = this.caculatedFactors; // this.periodicRad += this.periodicRadInscreament; data.forEach((value, i) => { const circle = this.circles[i]; const radian = inscrement * i; circle.x = center.x + (radius + value) * Math.cos(radian); circle.y = center.y + (radius + value) * Math.sin(radian); }); if (!this.previousGroupTexture) { this.previousGroupTexture =; } // if ( % 100 == 0) { const temp = this.effectSprite.texture; this.effectSprite.texture = this.previousGroupTexture; = 0.9; this.previousGroupTexture =; = 1; temp.destroy(); // } // } }
  2. I have implemented a music visualizer here: I created a cool trail effect in "circle.js". But after a while, the memory leak so bad. Can you point out what wrong with my solution?
  3. Should i use the default "" for every event or one instance of Phaser.Timer class for each? When i try the first solution, i encouter some strange behaviors with the timer. To be more specific, every 10 second i spawn a wave of enemies, this work fine, but when i loop an event for all enemies to fire every 2 secs then the enemies wave sometime spawn sooner than expected. Any suggestion?
  4. I have two short questions: 1. When enabling P2 physic on sprite, how can i disable the rotation on impact with other body, and how to disable game canvas bound so the sprite can move out of bound 2. set sprite.angle does not work with P2 physic, when i turn off P2, it work perfectly please help!
  5. lewster32 is an expert, every thing i searching for, every time he answered
  6. codart

    Generic key input

    lewster32, you saved my day. It's really, realy help full
  7. codart

    Generic key input

    bump! anybody here?
  8. Hello everyone, let me show you my case, i'm making a typing game in which player should be able to input keys in range of [a-z]. My problem is i do not find any thing like: game.input.onKeyDown(keyHandle); function keyHandle(keyCode) { if(keyCode===65) { console.log("A"); } } i just dont want to add handle for every key, it's seem to be overkill to me :< THank you for reading