-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phaser.Weapon's fire method not returning anything #2693
Comments
This should be a simple fix, I'm working on the contribution right now. Will submit a merge request if ya'll think it's a good idea. https://github.com/JTronLabs/phaser/commit/018b4b097ecd286cade9bf374a905d626f08b31b |
After looking at the code, making this change will also affect fireAtPointer, fireAtSprite, and fireAtXY, which is a good thing and makes for consistent behavior. |
I made the monumental |
You just edit the jsdoc block in the source files. All the html etc is On Wednesday, 17 August 2016, James [email protected] wrote:
Photon Storm Ltd. Skype: richard.davey Registered in England and Wales. |
Thanks Rich! I'll update the TypeScript defs in ~10 hours. Just to clarify, the changes I've made in this commit https://github.com/JTronLabs/phaser/commit/018b4b097ecd286cade9bf374a905d626f08b31b are enough to update the docs? And you agree that overall, would be a good change, correct? |
Yes I'm happy that Your jsdoc updates are enough, yes. |
Awesome, thanks. What npm command do I need to run for the new source to be reflected in the docs - maybe |
No, please don't. I can't merge PRs that contain any build files or docs On Wednesday, 17 August 2016, James [email protected] wrote:
Photon Storm Ltd. Skype: richard.davey Registered in England and Wales. |
submitted PR |
No, the CI fail is unrelated to your source. |
Thanks rich. The pr should be good to go then. Just FYI, i updated the typescript defs for 2.7.0 but not 2.6.1. I assumed since its already released we wouldnt want to change it. Is that right? If not i can update the PR. I appreciate you letting me make the changes so i can learn how to do it! |
You're right - we only ever update the dev branch defs, never master. |
Currently, Phaser.Weapon's fire method does not return any value (look for Phaser.Weapon.prototype.fire in the weapons file). The documentation says it should return false if a bullet was not found and the pool cannot be extended. It does not say what is returned if the bullet is found, presumably it is true?
I propose that instead of returning true/false, the method returns the fired bullet or null. This change will not break current code in the format
if(bullet)...
However, it will provide the new functionality of potentially manipulating the bullet after it has been fired (like setting tint). Currently, if you want to do this you would have to set all the bullets to the same tint, have texture for each tint, or try to dive into the guts of the engine and manually manipulate variables.The text was updated successfully, but these errors were encountered: