rich Posted January 9, 2015 Share Posted January 9, 2015 This thread is for discussion about Phaser Coding Tips 1. michaelcalkins, pinkman and Tuan 3 Link to comment Share on other sites More sharing options...
wayfinder Posted January 9, 2015 Share Posted January 9, 2015 Good read! Would it perhaps be easier to add the muzzle flash as a child of the cannon and turn its visibility on/off for shots? Then you wouldn't have to worry about angles and distances... michaelcalkins 1 Link to comment Share on other sites More sharing options...
Filozofer Posted January 9, 2015 Share Posted January 9, 2015 Great jobs ! Keep going, I will be your follower Link to comment Share on other sites More sharing options...
chg Posted January 9, 2015 Share Posted January 9, 2015 Good read! Would it perhaps be easier to add the muzzle flash as a child of the cannon and turn its visibility on/off for shots? Then you wouldn't have to worry about angles and distances...That would look different though (wouldn't it?): the muzzle flash sprite would be rotated to the angle of the barrel rather then being more pixelart-y and unrotated. EDIT: I guess you could rotate the child sprite by the negative angle of whatever you rotate the barrel by, cancelling it's rotation Link to comment Share on other sites More sharing options...
ekiscrim Posted January 10, 2015 Share Posted January 10, 2015 Nice! waiting for tips 2 Link to comment Share on other sites More sharing options...
oddskill Posted January 10, 2015 Share Posted January 10, 2015 very nice, thank you rich. Link to comment Share on other sites More sharing options...
Tuan Posted January 11, 2015 Share Posted January 11, 2015 Very useful, thanks Rich Link to comment Share on other sites More sharing options...
druphoria Posted January 12, 2015 Share Posted January 12, 2015 Nice tutorial. And I must say - that header image is absolutely adorable! Link to comment Share on other sites More sharing options...
rich Posted January 12, 2015 Author Share Posted January 12, 2015 Issue 2 is now finished ready to go out this Friday. And got some nice ideas for Issue 3 Link to comment Share on other sites More sharing options...
michaelcalkins Posted April 3, 2016 Share Posted April 3, 2016 Out of curiosity how would you make the tank's barrel follow your mouse? Link to comment Share on other sites More sharing options...
megmut Posted April 3, 2016 Share Posted April 3, 2016 @rich has already done an example on this. See here: http://phaser.io/examples/v2/arcade-physics/angle-to-pointer Link to comment Share on other sites More sharing options...
michaelcalkins Posted April 3, 2016 Share Posted April 3, 2016 @megmut Sorry I meant where say the tank could drive on the x axis and you wanted it to be able to rotate it's turret as a child sprite of the tank sprite. Link to comment Share on other sites More sharing options...
megmut Posted April 3, 2016 Share Posted April 3, 2016 @michaelcalkins I created a quick demo in phaser sandbox, check here. http://phaser.io/sandbox/edit/eOVasHyl Let me know if that's what you were looking for, cheers! pinkman and michaelcalkins 2 Link to comment Share on other sites More sharing options...
michaelcalkins Posted April 3, 2016 Share Posted April 3, 2016 @megmut Thank you so much! I was just trying to figure out how to work with radians from scratch, I wasn't on the right track either... Link to comment Share on other sites More sharing options...
Recommended Posts