phaser | Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web b | Game Engine library

 by   photonstorm JavaScript Version: 3.55.2 License: MIT

kandi X-RAY | phaser Summary

kandi X-RAY | phaser Summary

phaser is a JavaScript library typically used in Telecommunications, Media, Media, Entertainment, Gaming, Game Engine, Three.js, WebGL applications. phaser has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i @jwhite0042/phaser-ce' or download it from GitHub, npm.

Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps by using 3rd party tools. You can use JavaScript or TypeScript for development. Along with the fantastic open source community, Phaser is actively developed and maintained by Photon Storm. As a result of rapid support, and a developer friendly API, Phaser is currently one of the most starred game frameworks on GitHub. Thousands of developers from indie and multi-national digital agencies, and universities worldwide use Phaser. Take a look at their incredible games. Visit: The Phaser website and follow on Phaser Twitter Play: Some of the amazing games #madewithphaser Learn: API Docs, Support Forum and StackOverflow Code: 1770+ Examples (source available in this repo) Read: The Phaser World Newsletter Discord: Join us on Discord Extend: With Phaser Plugins Be awesome: Support the future of Phaser.

            kandi-support Support

              phaser has a medium active ecosystem.
              It has 34593 star(s) with 6992 fork(s). There are 1245 watchers for this library.
              It had no major release in the last 12 months.
              There are 97 open issues and 4036 have been closed. On average issues are closed in 201 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of phaser is 3.55.2

            kandi-Quality Quality

              phaser has 0 bugs and 0 code smells.

            kandi-Security Security

              phaser has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              phaser code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              phaser is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              phaser releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of phaser
            Get all kandi verified functions for this library.

            phaser Key Features

            No Key Features are available at this moment for phaser.

            phaser Examples and Code Snippets

            Example of how to use a phaser .
            javadot img1Lines of Code : 21dot img1License : Permissive (MIT License)
            copy iconCopy
            private static void usingPhaser() throws InterruptedException {
                    System.out.println("        >>> Using Phaser <<<");

            Community Discussions


            How to read position x of Shape Object when during tween
            Asked 2022-Apr-16 at 11:58

            I have the Circle object that extends shape and am trying to get the value of x or position of the object in 2d plane. During animation (tween) the position does not update and remains static. How do i fix this ?



            Answered 2022-Apr-16 at 11:58

            The enemy position x and y is not the position of the circle, that is used in the tween. An easy option is, just to create a property, so that you can acess the position, from the property.

            Here small example, how the access could work:



            adding a property in a class inside d.ts file inside node_modules typescript
            Asked 2022-Apr-04 at 17:12

            There is a class called 'Game' inside phaser.d.ts file inside node_modules/phaser.

            I want to add an extra property 'GLOBAL' to the class 'Game' without touching node_modules.

            how can I achieve it?



            Answered 2022-Apr-04 at 17:12


            How can I properly scale Phaser sprites?
            Asked 2022-Mar-31 at 19:29

            I have a couple problems with sprite scaling which seem to work fine for other people. So, this is my game:

            As you can see there are 2 big problems: the images are really pixelated and texture bleeding.

            This is my config:



            Answered 2022-Mar-31 at 19:29

            I just tried it on a small demo project, I think the solution is just, to edit your game - config to this (check code below).

            Info: You added the correct properties, but only into the physics- Object. I belongs one level higher.

            Like this it should work:



            player object undefined only in update()ƒ
            Asked 2022-Mar-31 at 15:14

            not exactly sure what to call whats going on. I need to create a definition for the clients main player physics body and i can't read it or any of its properties, no matter where or how i call it, from update(). Also if this is a bit hard to understand Im a young and new JS programmer so bare with me. Im willing to change the construction of my scenes if i need to if anyone recommends something easier.



            Answered 2022-Mar-31 at 15:14

            The issue is, that the update function is called, before a player is added (before the this.player is set).

            Since the update function will fire more or less right after the create function, the property player of the scene is not set yet. So this.player is undefined, which is the cause for the the error.

            The solution is to check, if the this.player property is set before accessing it, in the update function.

            As soon as the this.player property is set, the other commands in the if - clause are called.



            Getting last element on click every time in Javascript loop with Phaser JS
            Asked 2022-Mar-31 at 12:55

            I am making a game in Phaser although I believe the core of this issue is a lack of my JS understanding.

            I am looping through a Phaser container and wish to apply a click handler on each child sprite, but when I execute the click on any of the sprites, it always returns the last child.

            I have tried various suggestions on Stack Overflow eg here: JavaScript closure inside loops – simple practical example

            but can never get the click to return anything other than the last item.

            An Example:



            Answered 2022-Mar-31 at 12:55

            Your code is abit complicated. If you just want to add a EventHandler just, you don't need an extra closure. Just check the code below, for a leaner approach

            Working example:



            Integrate Phaser Game with React as component
            Asked 2022-Mar-31 at 11:17

            I'm new to React, I want to make a component for my phaser game to insert it into a react project.

            My Game component:



            Answered 2022-Mar-31 at 11:17

            One solution would be to move the creation of the Phaser.Game Object, "game" into the method componentDidMount (link to the documentation). Because if new Phaser.Game is called, and the parent is not in the DOM, the canvas will be added, ignoring the parent.

            just add this method to the Game class:



            Phaser 3 increase drag click area size of sprite
            Asked 2022-Mar-29 at 08:34

            We have a sprite which we set as interactive



            Answered 2022-Mar-29 at 08:34

            You can use the setInteractive method of the sprite, to define a valid hitArea, that is bigger than the "button", as requested. (here a link to the docs).

            Just define a hitArea and a hitAreaCallback, and it should work.
            (I using the Phaser builtin function to test it the point is in the hitArea, here the docs)

            Here a working demo:



            Moving the character a few tiles more seems to cause the whole scene (the physics world) to shake, why is that? How do I fix it?
            Asked 2022-Mar-17 at 19:44

            Here is the example code from phaser3 tutorial.



            Answered 2022-Mar-17 at 19:44

            In line #126 you have a shake function this.cameras.main.shake(300); that makes the game window to shake with a duration of 300ms. To disable it, just comment it out or delete it.



            Phaser 3 How to Access and Affect Player in Collision between 2 Objects Not Involving Player
            Asked 2022-Mar-10 at 08:14

            I am trying to create a grappling hook in Phaser 3. I can successfully shoot the grappling hook at an upward angle away from the player. I need to get the player to move towards the grappling hook when the grappling hook reaches its destination. The problem is that I can't access the player object in my Spawner.ts file to move the player object. If I could access the player object I could set the velocity at the moment of collision between the grappling hook and the level.

            This is the relevant code in the Spawner.ts file:



            Answered 2022-Jan-21 at 08:16

            Refactor the GrapplingHook constructor to accept the player too

            In Spawner.ts



            Webpack Define plugin replacement is evaluated but not injected
            Asked 2022-Mar-08 at 12:03

            I have JS library foo which is being built with webpack which includes and builds the source code of the Phaser 3 library. Phaser 3 uses the define plugin to exclude parts of itself, for example replacing "typeof CANVAS_RENDERER" with false.

            The issue I'm running into is this. when i include this block in my webpack config



            Answered 2022-Mar-08 at 12:03

            It seems that, if the plugin can't resolve each part of the if clause, in your case typeof WEBGL_RENDERER(since this is not defined in the new webpack.DefinePlugin), it doesn't resolve the rest.

            With other words, if you define both in the plugin it should work:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install phaser

            You can install using 'npm i @jwhite0042/phaser-ce' or download it from GitHub, npm.


            Go to to read the docs online using our brand new interface. Use the links to navigate the namespaces, classes and Game Objects lists and also use the new search box. The documentation for Phaser 3 is an on-going project. Please help us by contributing improved docs and examples.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone photonstorm/phaser

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link