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. Hello, so as the topic title states. How too keep default touch action that phaser has in phones when using gameController.js? i want to only have control on the left and still keep that touchEvent/function default.. if this is not possible is there better ways to make on-screen controls ? All the help i can get is greatly appreciated. Thanks in advance. -Learning.
  2. keyle

    Pinball like physics

    Hi. I'm attempting to make a pinball like game with Phaser. So far, not much luck with the physics system. I tried Arcade, Ninja and finally P2 and found the following issues: - Arcade and Ninja - I can't simulate the flipper hitting the ball at an angle. Seems the physic system is simplistic? I tried changing the angle and body angle with not much luck. - P2 - I can't seem to be able to "hold" the flipper at a fixed position, it always falls with gravitiy like the balls. Also, I can't seem to be able to change the anchor to something than the center of the sprite. Any help would be GREATLY appreciated.
  3. Hello, I would really appreciate some help. I am making a phaser game for a university project and have uploaded the current progress of the game to Kongregate. The game works fine on my laptop but I tried it on another laptop and it errors. The initial menu and loading screen loads and then when the game starts the sprites show but the tiles do not and there is a black background. On the console it says: webGL:invalid_value: texImage2d: width or height out of range. And that the texture is not a power of two. I'm assuming I may have to resize some of the assets I have used? I am confused as to why the game works on my laptop though. Also two players have scores on the leader board which I assume means the game worked for them also? Any help would be greatly appreciated. Thank you.
  4. I'm using a custom sprite for my main player. Based on the demo's I've seen I'm using `this.body.touching.down` to detect when the sprite is touching my bottom border. The problem is that when I use a custom sprite like this Phaser is first calling the `Phaser.Sprite.prototype.preUpdate` method which clears the touching state. Using `this.body.wasTouching.down` seems to work but seem semantically wrong since I'm trying to check the current state. Does anyone have ideas or suggestions on the appropriate way to do this? Here's the custom player sprite I have so far. The relevant piece is the last part of the update method. Also just to note, I do have a main Game object that has the typical update method and if I call `this.player.body.touching.down` it does resolve to true as expected but that's not encapsulating the behavior of the player which is my purpose for having a custom player object. BasicGame.Player = function(game, x, y) { // new Sprite(game, x, y, key, frame), game, x, y, 'dude'); game.physics.arcade.enable(this); // Player physics properties. Give the little guy a slight bounce. // this.body.bounce.y = 0.2; // this.body.gravity.y = 6; this.body.bounce.y = 0.4; this.body.gravity.y = 375; this.body.collideWorldBounds = true; // // Our two animations, walking left and right. this.animations.add('left', [0, 1, 2, 3], 10, true); this.animations.add('right', [5, 6, 7, 8], 10, true);};BasicGame.Player.prototype = Object.create(Phaser.Sprite.prototype);BasicGame.Player.constructor = BasicGame.Player;BasicGame.Player.prototype.update = function() { var cursors = BasicGame.input; // Reset the players velocity (movement) this.body.velocity.x = 0; if (cursors.left.isDown) { // if ( { // Move to the left this.body.velocity.x = -150;'left'); } else if (cursors.right.isDown) { // } else if ( { // Move to the right this.body.velocity.x = 150;'right'); } else { // Stand still this.animations.stop(); this.frame = 4; } // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && this.body.wasTouching.down) { // if ( && this.body.touching.down) { this.body.velocity.y = -350; }};
  5. jk90

    Loading Splashscreens

    I'm having problems displaying a splash screen/ loading screen using Phaser. I have managed to create a splash screen using text and a background colour, but one problem I am having is with displaying an image before the rest of the files have loaded. All of the loading of images must be done in the preload function but I cant use this function to actually display any images. What I would really like to do is load the splash screen image, display it and then continue to load the rest of the images ect. in the background. Preferably with text displaying the loaded %. Phaser apparently doesn't make this easy.
  6. Why aren't the physics engines stand-alone/plugin projects? Would it not be possible to have an adapter layer that must implement some interface for passing back collision data so that we could use which ever physics engine we wished and without having the bloat of trying to wrap other physics engines into Phaser? I'm asking this both from an academic and practical point of view. Is it slower to do it that way? Is it something you considered/attempted and decided it wasn't gonna work? Was it completely unfeasible? Just curious.
  7. While preparing a test project for this topic, I've come across something that seems to be a bug. I can reproduce it on the code from arcade physics body scale example. I've attached a zip file with the source code. Here are the steps to reproduce the bug on the body scale example code: move the game.physics.enable(sprite, Phaser.Physics.ARCADE); line just below the sprite creationset some scale (in my case 0.99)comment out sprite.body.immovable = true;comment out game.add.tween(sprite.scale).to( { x: 3, y: 3 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);The effect is that the first sprite begins to move right and downward (if the scale was set to some value greater than one the movement would be left and upward).
  8. Hi, I have a sprite that gets scaled up x4 during the game but is then reverted to scale x1. Despite of scaling it down to x1 the game.physics.arcade.overlap() reports overlaps as if the sprite was still at x4 scale. To scale the sprite back to x1, I use: sprite.scale.setTo(1, 1);Is this a bug or do I do something wrong?
  9. markus.n


    Hi, I'm doing my first game with Phaser, in a similar style of 2d point-and-click adventure games. All the controls of Phaser seem very nice for platformers, but this feels very unintuitive. What I need to do is to move an animated spritesheet character to where i click (or tap) on a flat 2d screen, preferrably with an even pace from start to finish. I started with this similar example: The main differences are that I want the Y coordinate to stay the same all the time (easy) and that the character should stay still until there's a click. I've tried all kinds of combinations with e.g.: - game.input.activePointer.isDown (doesn't really help, since I don't want to hold the mouse button while the character is walking). - game.input.activePointer.justReleased (doesn't help either, since the walking time isn't standard, and the character keeps moving with the mouse after it's reached its destination already) - game.physics.arcade.moveToPointer (would be perfect, if there just was a parameter for stopping when it reaches the point, now it just keeps going.) - game.physics.arcade.moveToXY(player, game.input.activePointer.clientX). (same as before) Any help is greatly appreciated!
  10. how to determine whether one object in sight of another? in version 1.9 everything worked.
  11. So my first html5 game is almost done and you can check it out here: Let me know what you think. Thank you.
  12. zenista

    [Complete][Phaser] The Guard

    Hi, Here is my complete game in Phaser. Link: Check it out and give feedback. Regards update: Game updated with following changes. 1. It uses Phaser 2 now. 2. Three difficulty levels removed. Instead, now difficulty is automatically increased after each 5000 score interval. 3. Now game directly starts into fast action mode.
  13. mamwalter

    Display time after pause/resume

    when i create a timer: this.gameTimer =;this.gameTimer.start();i can display seconds like this: this.gameTimer.seconds.toFixed(0)but if i pause my timer and resume it, it will not take care of the pause because .seconds is the duration since when the timer start. How can I display the time elapsed since the beginning of the game, taking into account pauses ? also this work perfectly: * 20, 2, removeStar, this);but this not: this.gameTimer =;this.gameTimer.repeat(Phaser.Timer.SECOND * 20, 2, removeStar, this);this.gameTimer.start();events are fired instantly.
  14. Hey, I have implemented a method to control enemy movement in a platform game. I have done it pretty sketchy and i'm wondering what would be a better / 'proper' way of doing it. Essentially it makes an enemy sprite walk to the end of a platform and when the sprite collides with the corner tile (before falling off the edge of the platform) the sprite then turns around and walks towards the other end of the platform and vice versa. I found that if I made the sprite turn as soon as it hit the corner tile that it would constantly go backwards and forwards on the spot because it was updating so quickly so I made it so it could only turn after a certain amount of time of previously turning. I know this solution is pretty sketchy but would be grateful if anyone could give me ideas as to a better way of doing this. Thank you., layer, this.enemyTurn, null, this);enemyTurn: function (enemyHit, layerHit) { if(layerHit.tile.index == 25 || layerHit.tile.index == 35 || layerHit.tile.index == 34 || layerHit.tile.index == 54 || layerHit.tile.index == 28 || layerHit.tile.index == 38 || layerHit.tile.index == 44 || layerHit.tile.index == 10) { if (enemyHit.body.velocity.x == forward && allowedToTurn == true) { timeWhenTurned =; allowedToTurn = false; enemyHit.body.velocity.x = backwards; } else if (enemyHit.body.velocity.x == backwards && allowedToTurn == true) { timeWhenTurned =; allowedToTurn = false; enemyHit.body.velocity.x = forward; } } timeSinceTurned =; if(timeSinceTurned > 0.06) { allowedToTurn = true; } },
  15. eugenioclrc

    [phaser] Circus Charlie

    Hi, i am developing a remake of the Circus Charlie. Feel free to be part of the proyect, or send me any tips or feedback. Personal blog: Source: Game (only desktop version):
  16. Hello, I have nearly finished a platform game I have made in Phaser. The game runs mostly fine, however sometimes when the state is changed to a new level and the player sprite is created, it falls through the floor tile, hence losing a life and restarting the level. I'm not sure why this is and it doesn't happen very often but does occasionally which seems odd. I would be grateful for any info as to what might be causing this. Cheers!
  17. programlocura

    Phaser + CocoonJS - PHP Services problem

    Hi everyone! I'm in the final phase from my game, fixing bugs to work like a charm on mobile, but i'm having a lot of problems with cocoonjs. A co-worker told me that Cocoonjs doesn't support PHP. I was working with an intermediate PHP file to call to an external URL (From a service) that returns information, but it only returns the file content itself. Now i'm trying to retrieve information from the service but i'm having cross-domain issues. Someone actually has achieved this? Any information would be appreciated. Regards.
  18. Bluesir9

    PHP Leaderboard on Phaser JS

    How can i use php to mantain a leaderboard in a game built using phaser js?
  19. SpriteWrench

    [phaser][wip] Hail

    So in the spirit of "completing" one game a week. Here is my next project with phaser: . Polish is definitely needed on this one. Any feedback would be appreciated! The plan is to work on 1 project a week (while touching up previous ones) for 3 weeks and use the 4th week of a given month to finish up, polish and port to mobile devices(android and/or iOS). The source code for these projects will be put up on my github: for review by the masses.
  20. Hi, I'm Cutler Cox. I am a junior in highschool who is looking for people to work with on the "Student Game Developers: Got Game?" competition by I am a beginning coder, so I am not going to be perfect, but I work hard to be the best I can be. I'm looking for an artist, but other roles are welcome because I would like this game to be polished and well thought out. Most likely the project will be in phaser, but if I am unable to get it going on that, I'll go for impact.js because of the great available resources, and the competition gave me a free license. Once again, all help is welcome, but there is no promise of pay for anyone. If we get the game is good and we put in ads, the revenue will be split between all the collaborators. Thanks in advance!
  21. Hi there, I'm trying to get off the ground with creating my own phaser games, but I've hit a blocker that I just can't work out. I have a very basic setup, based on the Phaser Tutorial examples: index.htmljsphaser.min.jsassetsstarfield.pngThis is my very, very basic index.html code - but it falls over at the first hurdle when I try to access a game.physics method: <!doctype html><html> <head> <meta charset="UTF-8" /> <title>hello phaser!</title> <script type="text/javascript" src="js/phaser.min.js"></script> </head> <body> <script type="text/javascript"> window.onload = function() { var game = new Phaser.Game(1900, 1000, Phaser.AUTO, '', { preload: preload, create: create }); function preload () { game.load.image('starfield', 'assets/starfield.png'); } function create () { game.physics.startSystem(Phaser.Physics.ARCADE); // The scrolling starfield background starfield = game.add.tileSprite(0, 0, 1900, 1000, 'starfield'); } }; </script> </body></html>In Chrome I get the following error: Uncaught TypeError: Object #<Object> has no method 'enable' (index):48 create(index):48 d.StateManager.loadCompletephaser.min.js:4 d.Game.loadCompletephaser.min.js:5 d.SignalBinding.executephaser.min.js:4 d.Signal.dispatchphaser.min.js:4 dispatchphaser.min.js:4 d.Loader.nextFilephaser.min.js:10 d.Loader.fileCompletephaser.min.js:9 This is all running locally under Apache. I have tried a few other basic things, but whenever I try to access any Phaser object methods I get this same 'Uncaught TypeError' issue. I have phaser-examples set up locally, and these run just fine - as do the Phaser Tutorial examples. I have been trying to just build out from the tutorials to experiment and get to grips with everything. I assume it's a really dumb error, but I just can't see where I'm going wrong. Any tips would be gratefully accepted. Thanks, Stu
  22. Finally, after weeks (I think around 3 weeks) of game design, refine, and coding, I finally able to put something decent up for showcase! The game, so far no named yet. The logic of the game is simple, don't get hit into the boxes! Just jump over or jump on the boxes to get scores. The game is at What left now is: 1. Music/sound 2. Better loading screen 3. Mobile management Please provide some feedbacks! Thanks!
  23. zxxz

    Default drag

    Hey I have a feature where a sprites velocity becomes the velocity of a moving platform when landing on it which worked fine. I have now however tweaked some of the controls including the drag.x and now when riding the platform the sprite slips off? I have also tried to change the drag to 0 when the sprite is on the platform but I get he same thing happen? Not sure of there is a way to essentially turn drag off or to whatever it is initially? Thanks
  24. rykket

    HitArea - Phaser 2.0.0

    Hi, I canĀ“t find any information on how to use the new hitArea property for Phaser 2.0.0, I want to use this to check whether the face of a character is clicked/pushed or if it the rest of the body that is clicked. I am pretty new to Phaser so hopefully someone can help me at either showing me where to find the documentation on this or give an example of how to set an area and how to check if this area is clicked. Thanks in advance!
  25. Hey I'm trying to find a tool that will let me export the correct style JSON to add to a sprite using the .setPolygon() method. I've tried all the export settings from PhysicsEditor and none seem to provide the correct JSON. Is this the best tool to be used to create points from a shape with a transparent background? The polygon itself is quite complex, consisting of around 400 points. I wonder if it's even possible with this many points?