Search the Community

Showing results for tags 'phaser'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 3,361 results

  1. Hi there little felas, I stumbled upon two ways to code with Phaser in OOP. Each one are diferent in how to code, and in how to structure your game. The first is the familiar Let's call it "flappy tutorial". And the second is the And this we call it "not-flappy tutorial". Well, the flappy tutorial uses a simple and easy to understand way to structure the game. He uses the objects/classes ass a simple module of code to be added to the main code, without any complication and any work to think about. In the not-flappy tutorial, I took a few seconds to understand how it works. He makes the object a extention of the Phaser.Sprite to determinate that object ass a sprite, and to add to the game, you have to add ass a existing object through Phaser.Game.add.existing and add the object ass a Phaser object. Cool huh? So, witch one of these ways make our game run smoothly? Take less time to execute? May the force be with us, so we can live long and prosper...
  2. Salvatore

    Rotate Camera

    How to rotate the camera?? Is there a angle method?
  3. nunziox

    Create random element at run time

    What is the best way to create an enemy at run time? Actually, i wrote this code: var position = % 500; if ((position>= 0&&position<=10&&enemies.countLiving()==0) && != 0) { var random_number = Math.random() * 100; if (random_number >= 0 && random_number <= 50) { enemy = enemies.create(, - enemyH - solidH, 'enemy'); rifbomb = w; enemy.body.collideWorldBounds = true; enemy.frame = 1; enemy.body.velocity.x = -80; } }
  4. Hi all Bit Fantasy is an HTML5 Multiplayer RPG that has been live for just less than a year now as an "early access" style game where people can help crowdfund the idea while it is in development. The unique points of this game are that there are no microtransactions and no commission for trading items with other players. We've had people from opposite sides of the world sell things they crafted to each other for real Bitcoin It started in a very basic form as part of the "release early, release often" ethos, to allow people to play it while it was developed. The very first version didn't even required javascript to be enabled The UI is now being rewritten to be smoother and better looking, and Phaser has been very nice for that. The game has an infinite world so loads tiles from the server as the players move around, players can build their own locations and roads etc.. Here's a preview of the new smoother UI we are working on. Screenie: If you want to try the current version of Bit Fantasy it's at - there's a free trial, you just need a bitcoin address.
  5. frankdev

    Setting Up Phaser Environment

    Hi all, Is there any way to set up a Phaser environment in a free ide so that the ide gives method parameters and descriptions? -Thanks
  6. Vrashq

    GameWeek ISART Digital

    Hi everyone, All the games of the ISART GameWeek are released ! If you're interested of game makes in a week, don't hesitate. lot of those games are made with PhaserJS ! You can find them here :
  7. I am adding Sprites dynamically by using a timed event. I can't find a way to bring a new graphics (a flooded rectangle) above the sprites generated. The sprites are always on top create() { var graphics =, 0); graphics.beginFill(0xFFFF0B); graphics.drawRect(0, 0, windowWidth, 70); graphics.endFill(); timer =, addSprite, this); } addSprite() { sprite= game.add.sprite(20, 30, 'sprite'); } Any help??
  8. I am adding new sprites in timed event ( I was trying to draw a filled rectangle above these sprites. I cannot figure out how. The sprites are always displayed on top Any help??
  9. askariwa

    Any tip on how this can be done ?

    I have searched on web but i didn't found anything useful so i am trying here for a tip. I want to make a game where i can handle a collision between a predefined game object (a sprite) and a dynamically shaped object, like the crate and the curve in the image attached to this post. I want to be able to change the curve charateristics programatticaly and still get the colision events with the game sprites. I was thinking about trying to do the checking on an off-screen canvas but i didn't find any kind of tutorial on this in any kind of game engine. Could it be possible doing it with Phaser ? Thanks in advance
  10. shmikucis

    Game editor on Phaser

    Recently our team has created two mini-games using and we find it pretty useful. We at MightyFingers decided to help fellow game developers and created editor on top of it and called it "MightyEditor". The idea is pretty simple - make it easier for everybody to work with the framework. Currently we have very basic features implemented like asset management, map creation, grouping in levels and data exporting. However without these basic things we would spend quit a time to create all levels we have. How does it work? Editor is web based tool and doesn't require any hassle like installation or authorization to the system. Simply go to and system will give unique URL where you will be able to return later on and continue your work with map creation. Real time testing is as simple as including URL given on editor top right in your game project. You can export data from editor at any time, no dependencies here. We have tested editor only on Chrome, no guarantee for other browsers For more info check out editor features section at our home page. Video tutorial Here is a list of the features that we are planning to implement in the future. Please vote for your favorite/most needed one or even request a new one – so we can focus more on the most required features: text object zoom in / out sound management tile map support import from tiled editor export to tiled editor sprite animation editor tween editor source editor user and multi user support version control for the projects
  11. yegorf1

    Slow moving in P2.

    Holla, amigos! How to slow moving of bodies in P2 physics? I need to substrat 1 pts from body speed per second.
  12. Hi all. I've been encountering this issue since some time now : I know how to initialise P2 Physics game.physics.startSystem(Phaser.Physics.P2JS);When I do this in the create of a State, everything is okay, I can enable bodies on sprites and set my callback events ( onBeginContact ...). I also listen to the broadphase callback and this is working. The thing is, if I move the code above to another State create() function, or in the Game create() function, I lose all my events, the physics seems weird, and the broadphase callback setting trigger an error ( about pairs parent ) Do I have to start a different physics system for each State? That seems weird to me. Thanks
  13. Hello, i have a group of platforms : create: function {this.platforms =;this.platform = this.platforms.create(,, 'yellow'); this.platform.anchor.setTo(0, 1); this.platform.scale.setTo(10, 1); game.physics.enable(this.platform, Phaser.Physics.ARCADE); this.platform.body.immovable = true; this.platform.body.reset(startwidth, startheight);}and i make them move like this : update: function{ this.platform.body.x -= 10;}The problem is, when a new platform come the last one stop moving, instead of move until leave the screen, is there any way to solve this ?
  14. lobsterhands

    Phaser and Tilemaps

    I'm completely new to HTML game making. Phaser is my first framework. I got curious about how tilemaps worked. If you already know, you may not need this. If you're brand new, check out this tutorial I found: If you have any good tilemap tutorials to add (specifically applying to Phaser), please add them here.
  15. Announcing the release of the latest from my backyard hack/pawn shop - Do leave a comment if you have suggestions and tips. Criticism is welcome too, of course.
  16. Hello, i have a movable platform, right now when the player is on it he move with it but i dont want that, i want him to fall when the platform go away, is there any way to do this ? (I use Phaser v2.0.3) create: function{ // the Player this.player =, 30, 'yellow');, Phaser.Physics.ARCADE); this.player.body.collideWorldBounds = false; this.player.body.setSize(50, 50, 0, 0); this.player.body.gravity.y = 2600; // platform this.platforms =; this.platform = this.platforms.create(0,, 'brick'); this.platform.anchor.setTo(0, 1); this.platform.scale.setTo(30, 1); game.physics.enable(this.platform, Phaser.Physics.ARCADE); this.platform.body.immovable = true; }update: function{, this.platforms); // moving the platform this.platform.body.velocity.x = -500;}if tried to add this : if(this.player.body.touching.down){ this.player.body.velocity.x = 500;}but is very bad because i want the player to stay on the exact same horizontal position all the game and with this he go on the right. any idea ? ps: this is my first post here so i take the opportunity for thank the phaser team ps2: sorry for my english i am not native
  17. Hi guys, I've participated last weekend to Ludum Dare 29 and made a ant simulation game using Phaser. The game I have written a postmortem on game entry is available here: Feedback on Phaser This was the first time for me to use Phaser, and this was quite an awesome choice. The learning curve was quite smooth, the concept are clean and simple. I mainly use the Phaser API documentation, however by doing so I missed some guidelines on what to do, what to not do. But I had 48 hours to make my game, so not so much time to read tutorials. I've recently browsed the library source code and it is quite a good thing to do if anyone wants to use Phaser (that was great to see how the framework works and all the optimisation tricks) During my development there was one thing weird about performances: So my game is a big map of dirt tiles, and I first wanted to use a set of ~ 10 Phaser.BitmapData so I can have different gradient of dirt, and for each tile I would use one of this bitmap data randomly. However, even if a BitmapData is (I think?) suppose to be cached, my performance was awful comparing to just using Image Sprite. Any idea about this performance issues? Thanks, @greweb
  18. nunziox

    Paint in a game

    I need of painting into a canvas while the game is run. I'd want to set the physic at the painted element. is it possible?
  19. Hi! I'm following the Tutorial: How to organize your Javascript code into classes using Phaser HTML5 game framework - Toastedware but, the body class appears "undefined" in other classes files. Using the Firefox Javascript console, this message pop in the Level.js: 'ground.body is undefined'How fix this? Everything works fine, but this cracks the whole execution. P.S.: My Level.js file: Level = function(game){ = game;}Level.prototype = { preload: function() {'background', 'assets/game01/sky.png');'ground', 'assets/game01/platform.png'); }, create: function() {, 0, 'background'); this.platforms =; var ground = this.platforms.create(0, - 64, 'ground'); ground.scale.setTo(2, 2); ground.body.immovable = true; // The trouble line } }
  20. quitnik

    Tetris issue [ Newbie Questions ]

    Hi guys, I have just started tries to make small games using phaser and decided to start from something very usual - tetris. So I am sorry for my stupid questions but I have spent some time trying to resolve the question by myself but without any success. As we know each tetris' figure consists from 4 blocks. Also I want to add some physics to my game. And this is the main issue that I have faced. 1. Can I use simple rectangle and not sprite as physics body? 2. If I am using sprite I have 1 block. As far as I have understood I need to create a joint from 4 such blocks to have one solid figure. Am I right? Or there should be used another way. Also if yes, how can I create such joint? P.S. any tutorials with tetris or something similar with usage of phaser will be very useful. Thanks and sorry for my stupid questions
  21. Hi! So inspired by Lessmilk I made my first game in a week. It is about matching colors and catching circles. It looks horrible and lags on Firefox, but works fine on Chrome. You can change your color with ASDF keys and move with cursor keys. Here you can play it: Here: Or here: (No ads! ) Here you can see my abysmal code skills: I would be very thankful for any honest feedback on gameplay and code (like, why isn't it performant and what could have I done better). Thank you!
  22. lewster32

    Swapping atlases at runtime

    I'm trying to put together an effect in a game where every sprite and image gets changed to a 'corrupted' version. I've created two texture atlases (with the keys 'sprites' and 'sprites-hacked'); both have identical data, but one has its source image modified. Without delving deep into the code, does anyone know if it's possible to quickly swap out all of the textures to use a new atlas? I've got so far as to change all non-animating sprites and images by simply using loadTexture, however if any of them are animating, they revert to the old atlas on the next frame. Main.prototype.setHacked = function (group, val) { var h = (val === true) ? '-hacked' : ''; for (var i = 0, len = group.children.length; i < len; i++) { if (group.children[i] instanceof Phaser.Sprite || group.children[i] instanceof Phaser.Image || group.children[i] instanceof Phaser.TileSprite) { if (group.children[i].frameName) { group.children[i].loadTexture('sprites' + h, group.children[i].frameName || 0); } } else if (group.children[i] instanceof Phaser.Group) { this.setHacked(group.children[i], val); } } };Ideally, it'd be nice if there was something I could use at runtime to simply update the source image for the atlas lookups, however from testing I can only manage to do that before I create any of the sprites - it has no effect after they've been created. If there is no current way to do this, I reckon would be a really handy feature to have to enable 'palette swap' type effects like you see in a lot of old games.
  23. Noid

    I know what the hearts mean

    (Either I'm the first to notice this or everyone thinks it's so obvious they didn't bother to write a forum post about it ) When I run my game, I see two red hearts and a gray one next to "Phaser vX.X.X ...". I thought it was just decoration but I noticed in screenshots from other people that sometimes there are three red hearts. So I inspected the piece of code responsible for the output of that line which, with 'pretty print' enabled, reads: var a = b.VERSION, c = "Canvas", d = "HTML Audio", e = 1;if (this.renderType === b.WEBGL ? (c = "WebGL", e++) : this.renderType == b.HEADLESS && (c = "Headless"), this.device.webAudio && (d = "WebAudio", e++), { for (var f = ["%c %c %c Phaser v" + a + " - " + c + " - " + d + " %c %c %c %c ♥%c♥%c♥ ", "background: #0cf300", "background: #00bc17", "color: #ffffff; background: #00711f;", "background: #00bc17", "background: #0cf300", "background: #00bc17"], g = 0; 3 > g; g++) f.push(e > g ? "color: #ff2424; background: #fff" : "color: #959595; background: #fff"); console.log.apply(console, f) }Notice there is an 'e' variable that starts at 1 and is incremented when c = WebGL and d = "WebAudio". There is also a loop using a 'g' variable and at the end an f.push line that compares e to g and according to which is greater sets color to #ff2424(red) or #959595(gray). So the meaning of the hearts are: ♥: Basic functionality ♥♥: Either WebGl or WebAudio enabled ♥♥♥: WebGl and WebAudio enabled That's really cool!
  24. JP91

    [Phaser] Archaic Roll

    This a clone of a game called Rapid Roll,I did it with the first versions of Phaser but I already had a little forgotten,so improve a bit the graphics and here it is. Archaic roll To play just use the left and right arrow keys to move the wheel and try to dodge the rocks with lava. In Smartphones touches the side you want to move the wheel. if you're interested in the code or something please let me know, enjoy.
  25. nunziox

    BMP vs Jpeg

    I made my game in js using phaser. My game is wrapped into android app using the WebView, therefore all resources are stored in local. My question is: In term of performance the best solution is use bmp images (without compression) or jpeg images?