Phaser (game Framework)
   HOME

TheInfoList



OR:

Phaser is a 2D game framework used for making
HTML5 HTML5 is a markup language used for structuring and presenting content on the World Wide Web. It is the fifth and final major HTML version that is a World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML ...
games for desktop and mobile. It is
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
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 Apache Cordova (formerly PhoneGap) is a mobile application development framework created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open-source version of the software called Apache Cordov ...
and
phonegap Apache Cordova (formerly PhoneGap) is a mobile application development framework created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open-source version of the software called Apache Cordova ...
.


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.


Architecture and features

Phaser can run in any web browser that supports the
canvas element The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap. HTML5 Canvas also helps in making 2D games. While the HTML5 canvas off ...
. Games made with phaser are developed either in
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
or
TypeScript TypeScript is a free and open source programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are ...
. A
web server A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
is required to load resources like images, audios, and other game files, as browsers require web pages to access files only from the same origin.


Rendering

Phaser can be either rendered in
WebGL WebGL (Short for Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated ...
or a
Canvas element The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap. HTML5 Canvas also helps in making 2D games. While the HTML5 canvas off ...
, with an option to use WebGL if the browser supports it, or if a device doesn't support it, it will fall back to Canvas.


Physics

Phaser ships with 3 physics systems: Arcade Physics, Ninja Physics and P2.JS. Arcade Physics is for high-speed AABB collision only. Ninja Physics allows for complex tiles and slopes, which are adequate for level scenery, and P2.JS is a full-body physics system, which supports constraints, springs, and polygon among others.


Animation and Audio

Animation can be done in phaser by loading a spritesheet, texture atlas and creating an animation sequence. Web audio and HTML5 audio can be used to play sound in phaser.


See also

*
List of game engines Game engines are tools available for game designers to code and plan out a video game quickly and easily without building one from the ground up. Whether they are 2D or 3D based, they offer tools to aid in asset creation and placement. Engines ...
*
Video game development Video game development (or gamedev) is the process of developing a video game. The effort is undertaken by a developer, ranging from a single person to an international team dispersed across the globe. Development of traditional commercial PC a ...


References


External links

*
Repository at GitHub

Discussions at Discord


{{Video game engines, state=autocollapse Free 3D graphics software Video game engines