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,368 results

  1. StuffBySpencer

    Help With Tilemaps And Tilesets

    I need help with creating tilemaps. I use tiled to create the maps, however it seems that tiled is counting my tileset image starting at 1, while phaser counts tilesets starting from 0. Because of this, whenever I make a tilemap, the blocks are out of order, and the map looks all screwey. Please help, I have attached an image to better explain this:
  2. mtburdon

    Pass parameter to button callback

    Hi there, I'm trying to do something which I think should be rather simple but I don't seem to be able to achieve it. When a button is clicked, I'm trying to pass a parameter to the button callback function, however if I pass anything to the function and console.log it out, it's always the clicked button. Is there a way to pass a parameter other than the button to the button callback? Thanks! Martin
  3. facetiousfactorial.cs

    Failed to execute 'decodeAudioData' on 'AudioContext'

    I've followed the directions on photonstorm's website the best i could to play audio whenever the world restarts. (This is a mod of a flappy bird project). the console reads: Phaser.StateManager - No state found with the key: main_state phaser.min.js:4Uncaught SyntaxError: Failed to execute 'decodeAudioData' on 'AudioContext': invalid ArrayBuffer for audioData. phaser.min.js:10My main.js: /*jslint node: true */"use strict";var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');var sfx = Phaser.Sound;var main_state = { preload: function () { = '#71c5cf';'george', 'assets/george.png');'pipe', 'assets/pipe.png');'sfx', 'assets/music.mp3'); }, create: function () { /*AUDIO*/ var sfx ='sfx'); /*SPRITES & MECHANICS*/ =, 245, 'george'); = 1000; var space_key =; space_key.onDown.add(this.jump, this); this.pipes =; this.pipes.createMultiple(20, 'pipe'); this.timer =, this.add_row_of_pipes, this); this.score = -1; var style = { font: "30px Arial", fill: "#ffffff" }; this.label_score =, 20, "Score = 0", style);'main_state'); }, update: function () { if ( === false){ this.restart_game(); }, this.pipes, this.restart_game, null, this); }, jump: function () { = -350; }, restart_game: function () {;'main');; }, add_one_pipe: function (x, y) { var pipe = this.pipes.getFirstDead(); pipe.reset(x, y); pipe.body.velocity.x = -200; pipe.outOfBoundsKill = true; }, add_row_of_pipes: function () { var hole = Math.floor(Math.random() * 5) + 1; for (var i = 0; i < 8; i++){ if (i != hole && i != hole +1) this.add_one_pipe(400, i*60+10); } this.score += 1; this.label_score.content = 'Score = ' + this.score; },};game.state.add('main', main_state);game.state.start('main');
  4. michael-Bell

    Game.Camera.follow Speed Increase

    I'm teaching myself how to use Phaser, and up until today, I've been using a very rudimentary method for keeping the camera focused on my player ingame. What I had in my update() function was: = player.y - 200; = player.x - 500;But recently I discovered the function. When I call;in the update() function instead of the previous two lines, my game is sped up greatly. You can see what I mean here: Hacky Camera follow: Arrow keys to move, when you perform a double jump(up arrow, then another up arrow while in the air), he spins, only in the second link, he spins much faster, and the only code I changed is the camera follow code. Anyways, I would like to know why the game sped up so much when I used the new code, and how can I tell if a line of code is very inefficient
  5. finiteadventurer

    Error: Sound.destroy

    Hi, I've been making my first game in Phaser (using Phaser 2.0.3) and have been looking to ensure that some sounds are garbage collected when they are no longer in use. I was hoping to use Sound.destroy to do so (which I think is a new feature to Phaser 2.0.3)/ However, when I call Sound.destroy, I am getting the following error (as pasted below from Chrome's console): I get the same error in all browsers tested (Chrome and Firefox). Has anyone else encountered this issue? Thanks!
  6. I stumbled upon an awkward issue with my game this morning. I wanted to see how my game performed on multiple browsers and I found that IE11 placed an awkward "Brightened" effect to my game. There is a screenshot below and the game link is here. I found no errors in the JavaScript console. How could this be happening?
  7. Inspired by Thomas Palef (lessmilk) and Luis Felipe Ocampo, I will be making one HTML5 game per week, in order to learn how to code games using the Phaser framework. I’ve been making demos and tests in my free time for almost a month, but never finished a real game, and I think it’s the right time to do it. All my games at Check my games, share them and give me some feedback, you can also my blog posts about game development and how I develope my one week games! Game #4 - Wriggle Worm Play here! Game #3 - Fast Racing Play here! Game #2 - Cloud Wars Play here! Game #1 - Circula Play here!
  8. michael-Bell

    Deleting off camera group items

    I'm still figuring out Phaser, and I've made a mario clone that involves shooting bullets at enemies. I'm trying to destroy the bullets after they leave the camera view, but I'm having some troubles. I have tried using bullet = bullets.create(player.x, player.y+8, 'bullet'); goodbye, this ); function goodbye(obj) { console.log(obj); obj.kill(); } Howevery, this never fires, even after the bullet has left the camera. I think that it might be because my world bounds are much larger than the camera is, so I tried making a function to destroy the bullets after they leave the camera like this: function checkBullet(){ bullets.forEach(function(item) { if(item.inCamera===false){ item.kill() } });} However this kills the bullets immediatly, which I also don't want. Is there a better way that I can go about this that will actually work?
  9. gbachik

    Creating A Ragdoll In Phaser

    So I'm trying to create a rag doll based game, where the user dodges some falling objects! It's inspired by one of my favorite games as a kid: There isn't really any documentation on this and frankly I'm pretty new to game development(not javascript though) Whats the easiest way to get a ragdoll running in phaser? I was able to find a vague reference leading to P2JS and its ragdoll example but: 1. I'm not skilled enough port it to phasers built in P2 2. The ragdoll isn't very similar to the one in ragdoll avalanche Is there a way to do this with sprites & maybe physics editor to get it running more the like example game I provided? Any help / example code you'd be willing to share is greatly appreciated! -Thanks for reading
  10. Zenryo

    [Phaser] ProTrader 3000

    Last week I created a kind of Stock Market parody game. You can watch the news to know if you should sell, buy or short the share. There is only one kind of paper: Money (MNY). Your currency is Cash. You have 2 minutes to make as much as profit as you can. The game is not fully complete, I want to add more News to the TV. Play it here:
  11. SpriteWrench

    Music Loading issue

    Hey Everyone So I have an issue. I'm currently loading music at my load screen as seen below: if (this.ready===true && this.cache.isSoundDecoded('someChords') ) { //this.ready=true; //hide loading css document.getElementById('ball').style.display = 'none'; //show game document.getElementById('tapjuggler-game').style.display = 'block';'menu'); } However, I'm finding that its taking forever on mobile devices (PC seems fine). I'm trying my best to troubleshoot the problem but I'm completely unsure of what to do. Is the file too big? Is there another way to "wait" for the file to start playing before moving to the next scene? Any help would be appreciated.
  12. So, this weekend I finish the design of my new game. I managed to go from here: to here: what do you think about my progress?? Do you like the new design??
  13. kpowgames

    Directional swipe

    Hello everyone, I'm fairly new to Phaser, and I'm just starting to figure things out. I made a simple prototype that uses "game.input.keyboard.createCursorKeys()" to listen and process the keyboard's cursor keys. Basically I have a sprite that moves up, down, left and right depending on input. Now I'm trying to achieve the same using touch events: when I swipe left, the sprite moves left; when I swipe up, the sprite moves up, etc.... but with no success. I've managed to detect swipe using a solution that user @imshag posted in this topic: It detects swipe, but doesn´t give me info on the direction of it. I could really use your help... How can I detect the direction of a swipe, and limit it to "up", "down", "left" and "right? Thanks in advance!
  14. Martiny

    [Phaser] ClickPic

    This is my first game, made with Phaser. It is an educational game made for my English students. I don't aim to win money from this in any way because I don't have the right of any of these images. Choose a category and click in the picture the text tells you. If you can test in your phones, that would be great. In my experience, the loading time is horrible, but I didn't find a way to improve it. Every image is around 50kb and I don't know how to make them smaller. Anyway, I'm glad I finished this game, it was a nice experience. If anyone wants, I can put the source code somewhere. Just bear in mind that this may not be a good source of information, since I'm just a beginner. Link: Bye
  15. trquoccuong

    Phaser on rails

    Hi everybody. I am studying Ruby on Rails and I see Phaser have a gem for rails.But I didn't find any tutorial for use it. I make a mini tutorial for run Phase on rails . What you need : Rails Installer ( easy way to install Rails ) Any edictor like sublime text .v.v In this tutorial I use the tutorial by Alvin Ourrad and Richard Davey. 's start Create a new rails applicationrails new gamesGo to games folder by command linecd gamesCreate a controller for this game rails g controller star indexInstall Phaser to RailsAdd this code to Gemfile gem 'phaser-rails'Run on command line Bundle installOpen yourdir/games/app/assets/javascripts/application.html.erb and add this line //= require phaserNow I will copy all images on the tutorial to yourdir/games/app/assetsAfter that I will copy javascript code of that game to yourdir/games/app/views/star/index.html.erbRun the rails server Go to http://localhost:3000/star/index and try your games You can also upload that games to heroku like this for my bad English
  16. gikdew

    Phaser LiveStream [Right now!]

    So, I was on, thinking about game development you know... And suddenly I discover that this guy is making a game live using phaser, you can watch how it developes here:
  17. FrankyCutty

    Phaser error my website

    Hi, I want add a game-banner to my website, I have a game width fixed height and full width responsive. I have this home banner: I want to make this(image photoshopped quickly): When I load phaser.min.js in my index.html, not any problem with this. But when I load my main.js the scrollbar disappear instantly: I load phaser.min.js and main.js just after jQuery files: The code of main.js is very simple, I want load a image sprite test: Not even I use the id 'phaser-game'. Thanks for all the help
  18. michael-Bell

    Limit number of objects in group

    Sorry if this is a simple problem, this is my time using Phaser I am making a simple platforming game where you shoot at boxes, I am trying to limit the number of bullets that can be onscreen at any given time. In TypeScript, you can pass along the max number when you create the group, as shown here( bulletGroup = myGame.createGroup(10); // the max number is 10 To make this group in Javascript, I would use BulletGroup =; But if I try to pass along 10, then I get an error in the phaser.js file saying: TypeError: c.addChild is not a function Can someone suggest how I can resolve this problem?
  19. Hi, I have a scene where a global gravity for Arcade Physics is set to 640. Then I try to set a lower gravity of 10 for a specific particle emitter, so to have the particles seem to float in the air. game.physics.startSystem(Phaser.Physics.ARCADE);// 1. Setting global = 640;game.physics.arcade.frameRate = 1 / 30;game.time.deltaCap = 1 / 30 * 2;emitter = game.add.emitter(0, 0, 100);emitter.makeParticles('particle');// 2. Overriding gravity for particle emitter.// Won't have any effect because of 1.emitter.gravity = 10;But it seems that it's not possible to override the emitter gravity if the global gravity is set. Commenting out game.physics.arcade.gravity.y = 640; makes the particles float in the air as expected. I've attached a test project showing the problem in action.
  20. Or a tutorial to create something similar?
  21. How would I go about detecting collosion of a player and a block(image)? The player currently collides with the block but I want to know how I could restart the game after this happens.
  22. LividPixel

    Sharp Screen Scaling?

    I'm working on a pixel art style game with Phaser and Typescript, and I was wondering how I would accomplish working in a 320x180 environment, and having it scaled up to 1280x720 (factor of four). I'd much rather be able to scale up the end result, rather than having to scale up each of my individual sprites. I've tried putting the small dimensions into my game constructor and setting scale.scaleFactor to (4, 4), but that didn't seem to do anything. None of the methods I've come across while googling seem give me my desired result. Any advice?
  23. jyapayne

    Phaser To Desktop Application Beta

    Hey everyone! I've been working on a little app for myself that allows exporting any html5 and javascript application to a "native" desktop application. It uses node-webkit to create binaries that work on all platforms. One awesome side effect of this is that node-webkit has it's own internal server, so there's no need to have a server installed to test your application. And, by enabling the toolbar, you can debug your apps just like you would in the browser. If you'd like to test the app and give me some feedback, that would be awesome. I'm hoping this will take down a part of the barrier of setting up a server in order to use phaser. Anyways, here's the link to my project: There are links to precompiled binaries on the github page and you can also check out the source code to see how it works. The source is kind of ugly right now and I need to clean it up a lot, but the app works and is functional on all platforms. Let me know what you think! Cheers!
  24. CarrotIsland

    Created Objects Collision Issue

    Hey all, I have been working on a side-scroller game in Phaser on and off for a week or so now and seem to have hit a wall. Basis of the game: You play a guy that shoots blocks and then uses said blocks to traverse a level. Problem: I am able to shoot blocks and finally able to jump off of blocks because I made them immovable. However, this removes their collision and thus all other blocks just go straight through them. This is a problem because I need blocks to stack and collide and such. Block Code In create(): blocks =;blocks.enableBody = true;blocks.physicsBodyType = Phaser.Physics.ARCADE; In update(): game.physics.arcade.collide(player, layer);game.physics.arcade.collide(player, blocks);game.physics.arcade.collide(blocks, layer);game.physics.arcade.collide(blocks, blocks);// movement codeif (shootButton.isDown) { fire();}function fire () { if ( > shootTimer) { shootTimer = + fireRate; block = blocks.create(player.x + 50, player.y, 'block'); block.body.immovable = true; block.body.collideWorldBounds = true; block.body.velocity.x = 400; } }All code: Gist - CarrotIsland
  25. Hi! I'm trying to figure out how to detach a sprite from a Group. Currently you add it with the group as a two-step process: 1) Create the Sprite 2) Add it to the group: group.add(sprite) But if I want to detach it from the group, so I can handle it individually, I have no other option than "destroy", which removes the Sprite. Setting the parent to null doesn't work either. The objective is that when a specific condition is met, the tween that is applied to all elements in the group as a whole doesn't apply to this particular sprite. Thank you!