Phaser (game framework)
Phaser is a 2D game framework used for making HTML5 games for desktop and mobile. It is free software developed by Photon Storm. Phaser uses both a Canvas and WebGL renderer internally and can automatically swap between them based on browser support. This allows for fast rendering across desktop and mobile. It uses the Pixi.js library for rendering. Games can be deployed to iOS, Android and native desktop apps via 3rd party tools like Apache Cordova and phonegap. History Richard Davey announced the first release of Phaser on a blog post in April 2013. Version 1.0 was released on September, incorporating the Pixi.js library for rendering. The last official version of Phaser 2 was 2.6.2, but to allow improvements to the stable version while working on Phaser 3, a new repository was created: Phaser CE (Community Edition). Phaser CE is thus the currently recommended stable platform for development with Phaser. Phaser 3.0.0 was released on February 13, 2018, and development is ongoing on GitHub. Most elements and features of the framework have been rebuilt from scratch using a fully modular structure and data-orientated approach. Phaser 3 includes a brand-new custom WebGL renderer designed for modern 2D games. Since then, much of the documentation and examples for users has been completed, and the majority of features have been implemented. Currently in development is Phaser 4, announced August 19, 2019, which is an attempt to rewrite Phaser 3 in TypeScript. It is not an API rewrite and will instead be focused on porting the scripts that are currently in Phaser 3 to TypeScript. The fundamental structure of an HTML5 game project A HTML5 game project typically consists of the following folders and files: Scripts/ (or js/): Within this folder one can find the essential framework file, which is typically referred to as “Phaser.js.” It typically contains a file that is dedicated to the game code that utilizes the framework. Src/: This folder is designated for storing source files. These files will eventually be compiled to create the complete game code. Assets/: Within this folder one can find various subfolders: Images: This holds graphical assets like backgrounds and sprites. Maps: This holds data necessary for any tilemaps used in the game. Sounds: This is where sound effects for the game are kept, often in multiple formats. Music: This contains music tracks for the game, also in multiple formats. Misc: Miscellaneous data, such as dialog files, runtime scripts, and other special files, are stored here. Index.html: This file serves as the entry point for the game. So, it sets up the game and initialises the loading process. JavaScript handles interactions after the initial setup. This html file may also include basic styling to position the game on the webpage and creates a user interface (UI) around it. Architecture and features Phaser can run in any web browser that supports the canvas element. Games made with phaser are developed either in JavaScript or TypeScript. A web server is required to load resources like images, sounds,