phaserjs / phaserjs/phaser

[docs] firstgame Tutorial: declare player variable in part5

Open
#7,236 0 comments 0 reactions 0 assignees View on GitHub

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.

Image

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:

Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.