ildede / toss-the-toast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toss the Toast

A game developed for the #Clujtronic2020.

Netlify Status

Prerequisites

You'll need Node.js, npm, and Parcel installed.

It is highly recommended to use Node Version Manager (nvm) to install Node.js and npm.

For Windows users there is Node Version Manager for Windows.

Install Node.js and npm with nvm:

nvm install node

nvm use node

Replace 'node' with 'latest' for nvm-windows.

Then install Parcel:

npm install -g parcel-bundler

Getting Started

Start development server:

npm run start

To create a production build:

npm run build

Production files will be placed in the dist folder. Then upload those files to a web server. πŸŽ‰

Static Assets

Any static assets like images or audio files should be placed in the public folder. It'll then be served at http://localhost:8000/images/my-image.png

Example public structure:

    public
    β”œβ”€β”€ images
    β”‚   β”œβ”€β”€ my-image.png
    β”œβ”€β”€ music
    β”‚   β”œβ”€β”€ ...
    β”œβ”€β”€ sfx
    β”‚   β”œβ”€β”€ ...

They can then be loaded by Phaser with this.image.load('my-image', 'images/my-image.png').

Dev Server Port

You can change the dev server's port number by modifying the start script in package.json. We use Parcel's -p option to specify the port number.

The script looks like this:

parcel src/index.html -p 8000

Change 8000 to whatever you want.

Other Notes

parcel-plugin-clean-easy is used to ensure only the latest files are in the dist folder. You can modify this behavior by changing parcelCleanPaths in package.json.

parcel-plugin-static-files is used to copy static files from public into the output directory and serve it. You can add additional paths by modifying staticFiles in package.json.

License

MIT License

About

License:MIT License


Languages

Language:TypeScript 98.3%Language:JavaScript 1.4%Language:HTML 0.3%