npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

phaser-es6-boilerplate

v0.1.2

Published

A stylish boilerplate for using Phaser with ES6

Downloads

2

Readme

Phaser ES6 Boilerplate

This repository provides a stylish boilerplate for using Phaser with ES6!

After creating my first Phaser game for the Ludum Dare I decided it would be a lot faster to have a boilerplate on hand. I looked around for existing Phaser - ES6 boilerplates, and while I found a couple of really good ones, I felt they didn't quite match my workflow. So I decided to make my own, which is this!

Getting Started

In order to use this boilerplate you will need to have Node.js, npm and gulp installed as these will be used to install the required dependencies for building the game.

Installation

Clone the repository (or download the zip):

$ git clone https://github.com/nerdenough/phaser-es6-boilerplate.git

Navigate into the project directory and install all the required dependencies for the project along with gulp (used to run the build tasks for the game):

$ npm install -g gulp
$ npm install

Usage

Serving

To serve the game so you can access it on your browser, you will need to run npm start or gulp. This will build the game and serve it on a web server using Browser Sync.

Once the game is running, the address and port to access the page will be displayed in the terminal window. Any changes to the code of the game will trigger a rebuild and the web page will refresh.

Building

You are able to build the game in 2 different modes: development or production. The development build will write sourcemaps for your game's code and will also copy phaser.js and its sourcemap instead of just phaser.min.js to allow easier debugging.

To build the game in development mode, simply run gulp build. A production build can be achieved by running gulp build --production.

Arguments

  • --production builds the application in production mode, minifying the javascript and excluding sourcemaps from the build.
  • --strict enforces the code styling rules defined in .eslintrc.json. The build will fail if the code does not meet the style guide's requirements.

In Depth

Source Code

By default, source code for your game is located in the src directory. Inside is a base minimal game boilerplate that you can use/adapt/delete based on what you need. The boilerplate consists of a main Game class and several game states to modulate the initial setup for the game.

Game

You can declare your states in the main Game class along with any other global game config.

Boot

Boot allows you to declare the initial settings of the game, such as the stage colour.

Preload

Preload can be used to load all of your assets, show a loading screen, and switch to the next state when loading is complete.

Play

Play serves as the main game state in this example.

Static

The static folder contains the web page and styling that your game will be embedded into.

Gulp

The gulpfile that contains all the tasks for building the game can be customised to your requirements. You can customise the paths for all the files being read or written through the paths variable declared near the top of the file.

ESLint

You can customise the rules for ESLint to use when linting your project by editing .eslintrc.json.

License

This repository is licensed under the MIT license.