Jump to content

Kiwi404

Members
  • Posts

    16
  • Joined

  • Last visited

Kiwi404's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. @BdR i need a destination bitmapData to do all the copyRect... work and then apply this new texture to the image. So if i understand what you mean, the 6 images have already a bitmapData associated (when they are instantiated) and i should use it instead of taking another bitmapData ? Thanks
  2. Hi, Is it relevant to apply a pooling system to Phaser's Tweens in optic to reduce the garbage collector invocation ? Because this subject as already been asked but dont find a clear answer : Thanks
  3. Hi, I'm making a dismemberment function of a sprite (human) when it died. This is how i see it : Get 6 bitmap (pooled) Copy with copyRect part of the sprite's texture (legs, torso, ...) and eventually resize these bitmaps Get 6 Image (pooled) and apply theses different textures Play some tweens to make parts fly randomly When tweens finished, free the 6 bitmaps and 6 image ( return to pool queue) Do you have any advices ( performance, ...) about this way ? Thanks
  4. Sorry it's a bad use ( i started the emitter outside of game state's update function, so there was randomly an out of sync ). No problems now.
  5. It seems this is not a "bug", but a planned change in Phaser since 2.7.7 to deprecate the update way of particles : https://github.com/photonstorm/phaser-ce/commit/cbe101fee2cdcb7add64e31aa1f289a13f9c8108 https://github.com/photonstorm/phaser-ce/commit/3ea0260777fccd7529e535693a920218a1645cde https://github.com/photonstorm/phaser-ce/commit/3a4c500f96536a27b90b78bb654f370bc0461757 I was able to make it work again ( emitter as child ) in the last build 2.10.6 by bringing back deleted "update" method of "src/particles/Particles.js" : update: function () { for (var key in this.emitters) { if (this.emitters[key].exists) { this.emitters[key].update(); } } } and re-append his call in updateLogic in "src/core/Game.js" : this.state.update(); this.stage.update(); this.tweens.update(); this.sound.update(); this.input.update(); this.physics.update(); this.particles.update(); this.plugins.update(); But i think that if they were deprecated it's for a good reason, @samme can you explain us how to get children emitters work in the 'normal' new way ?
  6. This bug is always present in 2.10.5 which forces us to come back in <= 2.7.5
  7. Hi, Is there any method to reset an emitter properly to be reused ? because i reuse a set of emitters but sometimes when i reuse a previously used emitter it show quickly his last state (repartition of particules in their last coordinates) and then restart his animation, so i wonder if is it a bug or a bad use. EDIT : It's a bad. Code used to instanciate the emitters in the poolEmitter (extended Phaser.group) instance : em = game.add.emitter(10,16,30) // some emitter settings (minRotation, setXSpeed,makeParticles...) em.kill() this.add(em) Code used in the poolEmitter instance to get a free (dead) emitter : let obj = this.getFirstDead(false) obj.revive() obj.x = x obj.y = y return obj Code used for exploitation of the emitter : let em = poolEmitter.create(player.x ,player.y) em.explode(800,30) setTimeout(function(){ em.kill() em.on = false em.visible = false /* em.forEach(function(p) { // I try this to hide the particule manually to avoid to be showed in their last coord when reuse the emitter, but dont work p.alpha = 0 })*/ },900) Thanks
  8. Thanks to your answer i have found a detailed explanation https://gamedev.stackexchange.com/questions/30425/vector-based-fonts-vs-bitmap-fonts-in-2d-games To summarize if you are concerned mainly about performance go with BitmapText. Thanks @samme
  9. Thanks @tips4design, its indeed what most others are saying. Is there any technical reason for that ?
  10. Hi, Which is the most efficient way when you need to deal with many text to display (mobile/pc) ? Because i spent times on forum and didnt find a clear answer (sometimes Phaser.Text, but often BitmapText) : Thanks
  11. Indeed I saw it while experimenting, it use physics bodies coord instead of sprite's coord. Thanks !
  12. Just a last question @samme, is there an equivalent of getObjectsAtLocation based on sprite's physics body or i need to check it manually by iterating over the array returned by this function ?
  13. Thanks you @samme exactly what i need !
  14. Thank you @samme exactly what i need ! EDIT : Sorry wrong thread...
×
×
  • Create New...