[docs] firstgame Tutorial: declare player variable in part5
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 40.3k
- Forks
- 7.2k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hi, in following the First Game tutorial, I noticed part5 of the published phaser.io documentation does not declare the player variable.
This can lead to an error if you're following along verbatim and could prove challenging to folks who are trying to get this working on the first try.
While the Github examples repo code does define this variable (html src, versioned html, js src, versioned js) the generated docs that are published on the website omit this and seem out-of-date.
I was intending to open a PR to suggest a fix, but the GitHub example code is correct, so the issue seems to be with how it's synced with the published versions on the site.
Additional Information
Of note, part3 does declare the platforms variable with var:
I suggest updating the part5 example to use a similar approach to prevent confusion (or adopt this.player and this.platforms like the Launcher Blade version of the tutorial does to avoid these scoping issues for this simple tutorial).
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the published Phaser first-game tutorial part5 with the linked examples repository files, especially the part5 HTML and JavaScript sources at the referenced commit. First determine how the examples are synchronized into the published documentation, then ensure the published example declares player consistently with the source. Done means the website tutorial works when followed verbatim and includes the declaration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100