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

  1. 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
  2. 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!
  3. 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.
  4. 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!
  5. 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.
  6. 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?
  7. Hey everyone! As part of a school project I've been working on a adapting an augmented reality software library called Chilitags into a very simple, very easy to use, more abstract JavaScript framework called Paprika. In short, what it does is allow you to use AR markers as input for your web application (with triggers for position, rotation, specific orientation, visibility, card flipping.) More info on it here: (I would really appreciate if anyone wanted to give a shot at making a small game using Paprika, or adapting one of your existing games/demos to use it, as any feedback from developers would help me with further development. Don't hesitate to contact me privately or through this post if interested.) Anyways, my approach was to implement paper input functionality along with 2 game demos created with Phaser. These demos are far from perfect games, but were mostly done to experiment with the interaction and test the different functionality developed for the framework. But hey I'd still love to hear what you think of them! (ideally you'd have to print the marker cards but there are PNG images which you can download to your phone and show your webcam, detection is pretty robust and works just as good either way.) Asteroids game: this game you control the orientation and color mode of a spaceship using a card. Plays like Asteroids, with color mode mechanics inspired by Ikaruga.It uses one 2-sided card and tests rotation tracking + flipping detection. Traffic Management game: this game you control which lane gets a green light at 4 crossroads, the objective being to let all cars through in the shortest time possible without letting (too many of) them crash.It uses four 1-sided cards and tests orientation.(edit: there's also a simpler, 1 crossroad version of it here I hope you enjoy these!
  8. Hi Phaser users. I have an problem with overlap function. Overlap created in update, so it run every frame. But problem is that overlap happens over ten times while sprite moving through it. How can I code that if sprite overlap with other object, they will never overlap again? I think about killing object that overplap with sprite, and then copy his attributes to other object that wont overlap with sprite. Maybe you will suggest better solution. create: function() { // Add player to scene this.poring = this.add.sprite(60, 128, 'poring'); this.physics.arcade.enable(this.poring); this.poring.body.bounce.y = 0; this.poring.body.gravity.y = 800; this.poring.body.collideWorldBounds = true; this.poring.animations.add('run', [0,1,2,3,4], 10, true);'run'); // Bush this.bushes =; this.bushes.enableBody = true; this.bushes.createMultiple(10, 'prontera_bush');},update: function() { // Overlap poring and bush this.physics.arcade.overlap(this.poring, this.bushes, this.lose, null, this);},// This will be triggered a lot of timeslose: function(poring, bush) { this.state.start('GameOver');},
  9. MakingVsPlaying

    [Phaser] Water Game

    I used phaser 2.0.3 to make this game for April's theme for (#1gam). Extremely simple and sort of clunky, but "finished". Just drag the rain droplets around. You can protect the flame or extinguish it and there is a button below the game to relight the flame. The game can be found HERE With a post about it at:
  10. This little project is my first attempt at making a game. It is "complete" in that I am likely done working on this since I've learned what I set out to learn: loading sprites, basic controls input, switching game states, simple logic flows, etc. I hope you enjoy or at least get a laugh out of it. Any critique is appreciated. Play here: Source:
  11. I am trying to move an image using tween. On the computer, It moves well but on smartphone it jumps and moves very slow, and also you cannot see the whole movement.
  12. yegorf1

    World bounds in P2JS

    Here again. My circles are ignoring world bounds. So there is code:, 0, WINDOW_WIDTH, WINDOW_HEIGHT);; = 0.8;;//...////...////...//chipsCollisionGroup =;this.chips =;this.chips.enableBody = true;this.chips.physicsBodyType = Phaser.Physics.P2JS;//...////...////...//function setupChip(chip, owner, game) { if (chipsCount[owner] < 1) return false; var MAX_MASS = 6; var mass = Math.ceil(Math.random() * (MAX_MASS - 1)) + 1; chip.scale.setTo(convertY(CHIP_SIZE / MAX_MASS * mass) / 64); chip.mass = mass * 100; chip.anchor.setTo(0.5, 0.5); chip.tint = PLAYERS_COLORS[owner]; chip.owner = owner; chip.dragging = false; chip.body.setCollisionGroup(chipsCollisionGroup); chip.body.collides(chipsCollisionGroup); chip.body.setCircle(chip.width / 2); chip.inputEnabled = true; chip.input.start(0, true);;; return true;}//Usally previous function calls like thisvar chip = state.chips.create(WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2, 'chip');setupChip(chip, PLAYER_FIRST,;
  13. yegorf1

    Circle physics

    Hello! I tried to make my game with physics. Prototype you can find here. First goes blue, than red, green, yellow. You can't win or lose, yet. As you can see, I use circles, but I use Phaser.Physics.ARCADE too and it doesn't support circles, so now there're squares instead of circles. How can I fix it? .Sorry for bad english
  14. lobsterhands

    How to Ride a Moving Sprite?

    Does anyone have an idea of how my player can "ride" a moving sprite. I want to jump on a horizontally moving block and my player to remain fixed in place on the block. Currently (with simple collision working) the block moves out from under the player. If anyone can point me in the right direction, I'd be grateful.
  15. ryancook1993

    Ragdoll Using P2.

    Hi, I have recently used phaser and p2 for a university project. Just wondering if anyone would be interested in an example if I put one together? Also, do you think this is something that would interest the guys at Phaser to the point where they could maybe post it in the examples? I used the P2 example from schteppe's Github and had a little help from him too. I would have to work to make it better to show it as an example, but its not bad. Had a little trouble with the scale of physics, tried setting the overall mass to 80 units(whatever they may be) and the gravity to 10 and it did not work, so think I have to figure out the physics units. Tried the pixel to p2 unit conversions with no luck either. I am willing to put in a bit of effort and make a reasonable example if it interests people. Here's a very buggy quick demo, had just finished ragdoll but not implemented any game features. As I said needs work, but let me know if anyones interested as I dont fancie putting in the work for no reason! Cheers.
  16. yegorf1

    Dotted line

    Hi again! Is there any way to draw dotted line, except sprite and many small lines?
  17. Just released my first game at It's an endless runner. Croaking, jumping and splashing. It's a bit rough around the edges and needs some fine tuning, too. Feedback appreciated. Updates: 1.1.0 Added 2 game modes (Time Attack, 30 Jumps). 3 in total now.Added Leaderboards (separate board for each game mode)Added a separate Score-Screen.Added smooth screen transition effect.
  18. Local_Minimum

    P2 collisions refuse to cooperate

    I'm very new to Phaser (<1 week) but I've stared at the examples and I think it really looks as if I'm doing the right thing, yet collisions refuse to work. In my gameState.create I run the following to set up my P2-physics: game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.setImpactEvents(true); game.physics.p2.restitution = 0.8;, -300, 8200, 20000); this.playerCG = game.physics.p2.createCollisionGroup(); this.enemiesCG = game.physics.p2.createCollisionGroup(); this.groundCG = game.physics.p2.createCollisionGroup(); game.physics.p2.updateBoundsCollisionGroup();and later adding the player: this.player = game.add.existing( new Player(this, game, 750, 180, 0)); game.physics.p2.enable(this.player); this.player.body.setCollisionGroup(this.playerCG); this.player.body.collides(this.groundCG, this.player.collidesGround, this); this.player.body.collides(this.enemiesCG); my grounds are the 'fistulaeHair' and are added: game.physics.p2.enable(fistulaHair); fistulaHair.body.kinematic = true; this.ground.add(fistulaHair); fistulaHair.body.setCollisionGroup(this.groundCG); I'm expecting this.player.collidesGround to be called when flying into the ground but nothing happens: It doesn't collide the the collidesGround has a console.log as first line which never fires. I must be missing something very basic it feels like. Also, as a side question, how do I test if I hit the world-end in P2-physics? Any help much appreciated.
  19. lobsterhands

    Falling Through Moving Blocks

    Friends, I'm having an issue with my player falling through blocks which move -- in this case vertically -- but only in Firefox (29.0). Chrome 34+ and IE11+ seem to be fine. It doesn't seem to happen under any clear circumstances. Sometime it is while jumping, stepping left/right, or just standing still. (Player bounce is not enabled, however the player does seem to bounce on the blocks as they descend. This could be an issue.) Code: Game: Any ideas?
  20. As you can see from this Fiddle, the change from 2.0.3 to 2.0.4 breaks game.stage.backgroundColorHow can I fix this?
  21. Hi all, So I'm trying to add background music to my game, and I've provided phaser with a .ogg and a .mp3 file so it has a fallback. Problem is, the audio doesn't play/load at all in Google Chrome (latest build). In Firefox the audio is working fine for me. I've looked at some examples on and added the audio the same way they did there, like this:'backgroundMusic', ['assets/audio/TakingFlight.mp3', 'assets/audio/TakingFlight.ogg']);Later in the javascript I play the music using this code: backgroundMusic ='backgroundMusic');'', 0, 1, true);Any suggestions / ideas? I've added the mp3 file of the background music in this post, wasn't allowed to upload the ogg.. TakingFlight.mp3
  22. yegorf1

    Change sprite color

    Hello! Just started to learn phaser and have a question: I have a gray sprite, how can I make it draw blue and after some event make it red? I tried to find it but haven't any progress. If there're no solutions, all task: I want to make blue circles with physics body and if circle is colise with another - change color of both to red. Thanks. Sorry, for bad english :|
  23. Hi! I have a strange behavior: when I start game first time on mobile browser (with clear cache) it runs very slow. But when I reload page it performs much better. May be someone faced with similar. [EDIT] I've tested on chrome & safari, it occurs only in chrome. [EDIT2] Oh, looks like this is random thing, depends on device's processor loading..
  24. Gabahulk

    Levitation with P2 Physics

    Hello! I´m newbie in Phaser and game programming, And I want to make a open air artillery game. I want the characters to have a up and down movement as if it they were levitating and I was wondering what was the best way to do it with P2 since it will be a artillery game and i'd like to see the characters react to the physical impact of projectiles while levitating. Sorry for any misuse of english (not my native language) and thanks!
  25. Hello! I am 27thColt. This is my first game that I have ever made! It is called Floater (couldn't think of better names). You are a Scuba Diver avoiding fish and collecting coins and bubbles! Here is the link: Here are some pictures: If you want, here is the repository: Just don't steal my code guys, it's not cool. Hopy you enjoy the game!