Skip to content

[docs] firstgame Tutorial: declare player variable in part5 #7236

@vanm

Description

@vanm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions