Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing JavaScript Finishing the Game Adding New Graphics

phaser.js file?

Can anyone explain its role? Why is it required? When to use it?

Steven Parker Steve Hunter

4 Answers

Steven Parker
Steven Parker
231,248 Points

I believe phaser.js is the main game system library containing the functions that you call to create game objects and move them around. You use it so your code can focus on the game play and not deal with all the details of pixel drawing and animation.

Steven Parker
Steven Parker
231,248 Points

If you want to use it to create your own games, it would be good to understand what the functions do so you can make use of them in your game. This course gives you a very brief introduction to some of them, but to make the most of what the system offers, you might want to take advantage of the other learning resources on Phaser's web site.

Sean T. Unwin
Sean T. Unwin
28,690 Points

Phaser.js is a JavaScript game framework. You can learn about it at Phaser.io.

Dave gives a brief introduction to it in the first video and also there is a link (the same I offered above) in the teacher's notes at the bottom.

For this course, there isn't a direct need to understand what is offered in this library, but know that any code relating to the game variable, as well as any variables which derive from it, are utilizing the Phaser framework.

To make use of phase.js don't we need to understand what does it do? How it can be used? In which functions?

Steven Parker
Steven Parker
231,248 Points

See the comment I added to my answer.

Thanks