Skip to content
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

Cahpter 6: this.playSound is not a function #4

Closed
Frozenfire92 opened this issue Oct 13, 2014 · 2 comments
Closed

Cahpter 6: this.playSound is not a function #4

Frozenfire92 opened this issue Oct 13, 2014 · 2 comments

Comments

@Frozenfire92
Copy link

I have loaded the sounds using this.loadSounds() in App.js but when I go to call this.playSound("shoot"); in Player.js I get the following console error

TypeError: this.playSound is not a function
@dub4u
Copy link

dub4u commented Oct 13, 2014

Because this in Player.js refers to the Player instance. You need to use app.playSound("shoot")

@Frozenfire92
Copy link
Author

Literally just tried that 😄

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants