Pixelguy Posted January 4, 2014 Share Posted January 4, 2014 (edited) Hey folks! As someone with a very basic skill in JavaScript, I'm trying to make my first little moon lander game to mess around with the framework.Currently its just a lander with limited fuel flying around. Nothing special.But I already feel like I could do better code organisation wise... I tried to make the lander and it's emitters (engine particles) a group but I failed doing so. Currently each udate() I have so align all the emitters x/y to the lander sprite. That feels just wrong.I'd also love to adjust the particle drag/initial particle speed since there is no air resistance in space but failed there. Any feedback or advice is welcome! http://jsbin.com/udIMoLo/1/edit?html,output Edit: Controls are Arrow Keys and Spacebar Edited January 4, 2014 by Pixelguy JHardin1112 1 Link to comment Share on other sites More sharing options...
jerome Posted January 4, 2014 Share Posted January 4, 2014 Very nice Link to comment Share on other sites More sharing options...
Pixelguy Posted January 4, 2014 Author Share Posted January 4, 2014 Thanks Jerome! Any guidance related to the grouping (controlling the lander & emitter's position as a group) and particle speed/drag is much appreciated Link to comment Share on other sites More sharing options...
XekeDeath Posted January 4, 2014 Share Posted January 4, 2014 Particle emitters are already Phaser.Groups, and as such can't be added to other groups.Thee only other way you can adjust where the particles are is by setting the emitX/emitY values on the emitter.This will spawn the particles at a new location without moving the entire group.It may give you a different visual effect to what you have now, as the group moving moves all children (as they are relative to the parent) but the emit coords changing does not. Link to comment Share on other sites More sharing options...
Recommended Posts