How to Set Up a Game with Phaser 3
Zenva
ACCESS the FULL COURSE here: https://academy.zenva.com/product/html5-game-phaser-mini-degree/?zva_src=youtube-html5md
TRANSCRIPT
We're gonna go ahead and start building out our game and Phaser. For this project we're gonna make use of the Phaser 3 project template. It's available on GitHub. The template was put together by Photon Storm. One of the nice things about the template is it uses Webpack which will allow you to take all the JavaScript files you write during development and it will compile them all together into one built file that you'll use when you deploy your game. Another nice feature is it uses Node.js to install all the dependencies that are required for your project. But it also uses Node to run a local server that you can use for development. That way you don't have to set up a different server for developing your game locally. Since the project requires Node.js to run, if you don't have it installed you can go to Nodejs.org and it'll take you to the downloads page for your machine. And you'll have two different options. One is LTS and one's current. LTS is the long-term support of Node.js, and current has all the newest, latest and greatest features. LTS is recommended for most users, but you're definitely welcome to use current if you would like to. Both of them will work with this project. To install Node you just click on the version you'd like to use. Once the installer is downloaded, go ahead and run it. And you just follow through the prompts and it'll install Node.js for you.
After it's installed in your terminal or command prompt, you can do Node -v and it'll show you which version of Node.js you're currently running. If you need to install Node.js, go ahead and pause the video now. And then go ahead and come back to it once it's done. Alright, with Node installed on your machine, we can go ahead and get a copy of the template. There's two ways to get a copy of the project. The first is to use Git to clone the repo which will copy all the files onto your local machine. The second is if you don't have Git or you're not familiar you can just download a .zip which will download all these files here for you onto your machine. I'm gonna go ahead and do git clone, so we do git clone. It'll go ahead and copy all those files. So you'll see I have the Phaser 3 project template, so I'm gonna go ahead and go into it. And you'll see all the files are here. The first thing you have to do to use the template is you need to run the npm install command. So if you're not familiar with npm install, what it does is it looks for a package .json file located in your current directory, and in that file we list all the dependencies that are needed for our project in order for it to run properly. It's great because it allows you to share your c ... https://www.youtube.com/watch?v=bo3BNf3XDNc
62611351 Bytes