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, 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 or a canvas element, with an option to use WebGL if the browser supports it, or if a device does not support it, it will fall back to Canvas.
Physics Phaser ships with three 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. As of phaser 3.6, there are two major physics engines. These are called Arcade and Matter. There is also a less known engine similar to Arcade called Impact. Arcade is probably the most used out of the three, since it is fast and easy to use. It uses axis-aligned (not rotated) rectangles and circles for collision detection on top of all basic physics engine features, like gravity, acceleration and drag. Its downside is that its features are limited. Complex hitboxes can be very difficult to make out of the supported shapes and multiple objects in close proximity can cause stability issues. Matter is the more advanced physics engine but its complexity also rises with the added features. Matter is capable of simulating very realistic full-body physics. It supports a multitude of features such as rigid, compound and composite bodies, elastic collisions, stable stacking and physical properties like mass and density. Impact holds many similarities to Arcade but brings some useful advantages. For example, Impact can have slopes in its tilemaps, which is not possible with Arcade's axis-aligned rectangles. However, the downside to this is that developers have to use the Impact engine's developer's own "Weltmeister" editor for creating tilemaps.
Animation Phaser supports spritesheets and texture atlases, which include multiple frames or character animations. Developers can use frame sequences to craft animations. Phaser's animation sequence capability allows developers to effortlessly create animation sequences for sprites, including control over looping, speed, and frame rates. From simple character movements to complex special effect animations. Furthermore, Phaser offers a built-in tweening engine for crafting smooth transition animations. This is particularly useful for effects like fading, scaling, rotating, and can also be used for other complex special effect animations.
Audio Phaser allows developers to manage and play web audio and HTML5 audio, providing a rich set of audio effect control options, including volume, mute, looping, fading in and out, and sound positioning. These attributes can be adjusted as needed. Additionally, Phaser supports preloading of audio files, ensuring sound plays without delay, ready for immediate playback, delivering a better gaming experience. == Comparison with other lightweight game engines ==