Weapon.Fire now tracks offset rotation #2672

Merged
merged 4 commits into from Aug 25, 2016

Projects

None yet

2 participants

@bobonthenet
Contributor

Important: Pull Requests should only be issued against the dev branch. PRs against the master branch will always be closed.

This PR changes (delete as applicable)

  • Nothing, it's a bug fix

Describe the changes below:
I don't think Weapon.Fire is working properly when you are using an offset and tracking rotation. This fixes it so it works the way I think it should.

@photonstorm
Owner

Thanks for the PR and your contribution. I like this change a lot, but I don't want to create a new Point object every time you fire a bullet. Instead please could you update it to use a private local point instead, and just recycle it?

@bobonthenet
Contributor

So forgive my noobness and thank you for the opportunity to contribute to this project. It means a lot to me to be able to learn from this experience and be a part of this. I think I've done what you've asked and it seems to work in my application. Let me know if I should change anything else.

@photonstorm photonstorm merged commit dfbdd59 into photonstorm:dev Aug 25, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@photonstorm photonstorm added a commit that referenced this pull request Aug 25, 2016
@photonstorm Created _rotatedPoint in the constructor, and tidied up code formatti…
…ng to match the rest of Phaser #2672
cbbb2cd
@photonstorm
Owner

This is now merged into dev. Just so you know, I had to update the code a little. The code style didn't match that used in the rest of Phaser (in terms of spaces before braces, that kind of thing). I was going to point it out, and let you change it, but I want to release 2.6.2 with this fix in, sorry :)

@bobonthenet
Contributor

Thanks, his has been an exciting learning experience for me. No need to apologize. I hope to contribute more so I took a look at your commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment