Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Game Development with Phaser!
You have completed Game Development with Phaser!
Preview
Explore the steps to install and configure Phaser using NPM, and leverage Vite's hot module reloading and development server for a smooth and efficient dev environment.
Phaser config code:
const config = {
type: Phaser.AUTO,
parent: 'game',
width: 1920,
height: 1080,
backgroundColor: '#2F2F2F',
scale: {
mode: Phaser.Scale.FIT,
},
scene: LevelOne,
physics: {
default: 'arcade',
arcade: {
gravity: false
}
},
}
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Now, you may be wondering why we're having
another video to set Phaser up since
0:00
we already did that in the previous stage.
0:02
Well, in the previous stage
our game was quite small so
0:05
we didn't need many tools to manage it.
0:08
The game we're going to build in
this stage is a bit bigger and
0:10
we're going to be using multiple
files in our source code.
0:14
So we're going to need some sort of tool
to help put these files together, and
0:17
that tool is called Vite.
0:22
Vite is a fast and
efficient build tool for JavaScript,
0:25
which provides us with
a development server.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up