docs.phaser.io example causes `Uncaught TypeError`
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 40.3k
- Forks
- 7.2k
- PR merge metrics
- No merged PRs in 30d
Description
https://docs.phaser.io/phaser/concepts/gameobjects/image#custom-class
Hello.
Example shows:
this.add.existing(this);
Descriptions about this line says Adds an existing Game Object to this Scene
this is the current instance of the class Phaser.GameObjects.Image
So there should be:
scene.add.existing(this);
Where scene is constructor argument.
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
Open the linked custom-class example in the Phaser documentation and inspect the line that calls this.add.existing(this). Update the example to use the constructor's scene argument, then verify that the example no longer causes the reported Uncaught TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100