Ninjadoodle Posted February 8, 2018 Share Posted February 8, 2018 Hi @enpu I have a couple of problems with particles. These could be my fault but I just can't see what I'm doing wrong Firstly, the particles are loading the wrong image, instead of the one I tell it too (in my case they are loading half of a bottle sprite, instead of the shard image). And second, I can't seem to set the x, y position. The particles always appear at 0, 0, no matter what I set the position to. game.createClass('S06Shard', { init: function(x, y) { this.particles = new game.Particles(); this.particles.textures.push('s06Shard.png'); this.particles.position.set(x, y); this.particles.emitRate = 0; this.particles.angleVar = 0; this.particles.accelSpeed = 200; this.particles.speed = 100; this.particles.life = 1000; this.particles.addTo(game.scene.fg); this.fire(); }, fire: function() { var count = 4; for (var i = 0; i < count; i++) { this.particles.angle = -Math.PI; this.particles.angleVar = Math.PI; this.particles.emit(); } } }); Quote Link to comment Share on other sites More sharing options...
enpu Posted February 8, 2018 Share Posted February 8, 2018 @Ninjadoodle Can't see anything wrong with your code. Does it work without hires? Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 8, 2018 Author Share Posted February 8, 2018 Hi @enpu Yup it does - hires is the issue Quote Link to comment Share on other sites More sharing options...
enpu Posted February 8, 2018 Share Posted February 8, 2018 @Ninjadoodle Damn you hires! Just pushed small change to dev branch, can you try if it fixed it. Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 8, 2018 Author Share Posted February 8, 2018 @enpu it fixed the position but not the image loading (from atlas). I know lots of bugs with hires - but it’s sooooo useful lol. Quote Link to comment Share on other sites More sharing options...
enpu Posted February 8, 2018 Share Posted February 8, 2018 @Ninjadoodle Gladly those are usually really easy to fix (once you find the issue) Can you send me those atlas files so i can do some debugging? Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 8, 2018 Author Share Posted February 8, 2018 @enpu Just sent it through - if you need the project as well, let me know Quote Link to comment Share on other sites More sharing options...
enpu Posted February 8, 2018 Share Posted February 8, 2018 @Ninjadoodle Should be fixed now! Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 8, 2018 Author Share Posted February 8, 2018 @enpu - Nice! Works perfectly now Thaaaaanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.