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
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 3,067 results

  1. Posted 2 hours ago Is there a way to create sprite from multiple files ? Like creating a sprite : Knight in 'knight.js' and creating his movement in 'movement.js' is this possible : // knight.js import Phaser from 'phaser' import Movement from './movement' export default class extends Phaser.Sprite { constructor ({ game, x, y, asset }) { super(game, x, y, asset) } movement(){ // Here Ill call Movement } } // movement.js import Phaser from 'phaser' export default class extends Phaser.Sprite { // Here ill make a function that will move the sprite // and start the animation }
  2. Is there a way to create sprite from multiple files ? Like creating a sprite : Knight in 'knight.js' and creating his movement in 'movement.js' is this possible : // knight.js import Phaser from 'phaser' import Movement from './movement' export default class extends Phaser.Sprite { constructor ({ game, x, y, asset }) { super(game, x, y, asset) } movement(){ // Here Ill call Movement } } // movement.js import Phaser from 'phaser' export default class extends Phaser.Sprite { // Here ill make a function that will move the sprite // and start the animation }
  3. Solitaire Fortune

    One small fun solitaire game. Made with my favorite Phaser Play Game: Solitaire Fortune Get Solitaire Fortune for Android
  4. Pixi v4 filters in Phaser

    I would like to use Pixi v4 filters in Phaser node application. I´ve read this tutorial: and all posts about this that I´ve found, but I still don´t know, how am I supposed to load the filter script. For example the outline filter: game.load.script('filter', 'outline/src/OutlineFilter.js'); However, this is not working and I just can't figure out, how to load it correctly. (The path is correct.) Thank you
  5. Gopherjs and Phaser

    Hi, I've recently started to experiment with Gopherjs ( ) for Phaser games. Idea was to write backend and frontend in same lang (I use go on backends I create for clients). Managed to recreate example in go without much trouble, but now I'm creating game template with states and can't properly add multiple states. When I console log the game.state.states object I see all my states, but it always starts last one no mater which key I use in game.state.start(). Anyone here with experience in Phaser and Gopherjs?
  6. Hi everyone, I have problem with scalling to mobile devices in phaser. I mean, every graphic in my app on PC is scalling correct on mobile devices and everything look perfect, but hitArea on sprites that have inputEnabled = true stay on the old positions and when I want to interact with sprite on my phone I have to click a little bit below and to the right from the sprite position. I use this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; to scale the game to mobile devices. Have anyone idea what is wrong?
  7. Sprite Animations

    I'm trying to add some new animations by adding a new "if" section in my "update:function" code. All of my "walking" and "sprinting" animations following the first "if" section play as they should. However, when I attempt to animate my crutch attacks under the second "if" section, only the first frame of those animations is played. I'm using the same attack button because it's the same attack being animated in all directions. I combo'd with my arrow keys so that I could use the same attack key. When I change them to all to "else if" statements under my first "if" section they don't play because it is my understanding that once a key is used in an "if" statement all other attempts to use that key under that section will be ignored. My code is listed below. Solution? if(cursors.left.isDown) { player.body.velocity.x = -200; player.scale.setTo(.7, .7);'walking'); } else if(cursors.right.isDown) { player.body.velocity.x = 200; player.scale.setTo(-.7, .7);'walking'); } else if(cursors.down.isDown) { player.body.velocity.y = 200; player.scale.setTo(.7, .7);'forward'); } else if(cursors.up.isDown) { player.body.velocity.y = -200; player.scale.setTo(.7, .7);'backward'); } else if(sprintl.isDown) { player.body.velocity.x = -400; player.scale.setTo(.7, .7);'sprinting'); } else if(sprintr.isDown) { player.body.velocity.x = 400; player.scale.setTo(-.7, .7);'sprinting'); } else if(sprintu.isDown) { player.body.velocity.y = -400; player.scale.setTo(.7, .7);'backsprint'); } else if(sprintd.isDown) { player.body.velocity.y = 400; player.scale.setTo(.7, .7);'forwardsprint'); } else{ player.animations.stop(); player.frame = 29 player.body.velocity.y = 0; } if(cursors.left.isDown && fireButton.isDown) { player.body.velocity.x = -50;'sidecrutch'); } else if(cursors.right.isDown && fireButton.isDown) { player.body.velocity.x = 50;'sidecrutch'); } else if(cursors.down.isDown && fireButton.isDown) { player.body.velocity.y = 50;'frontcrutch'); } else if(cursors.up.isDown && fireButton.isDown) { player.body.velocity.y = -50;'backcrutch'); }
  8. Can I Rotate The Stage?

    Hey guys, I want to make a game which has two layers like the uploaded images. It is a skiing game, there are background elements in the layer1. Also there are game elements in the layer2. I don't know how to create layer in the game. So I think that I can use the as the layer1 and the phaser.stage as the layer2. However, I found that I could not rotate the whole stage such as game.stage.rotation=0.1; It doesn't work. So I want to know how can I rotate the stage? Or can you give me some idea for this game? Thanks.
  9. [WIP] Kawaii Ketchup

    I've kinda been developing this game in a vacuum. So, if it wouldn't be too much trouble for you, and if you would like to, could you give me criticism or feedback such as what the game does that appeals to you or what the game does that you don't like? I might be missing something, I think. It's still a work in progress (kinda like an alpha version?) and I hope to have it really polished by the end of the first quarter of 2018. Also, I kinda just wanted to share and promote the game It's like an arcade game where you try to avoid getting hit by flying ketchup bottles and then you eat raisins in order to stay alive. And also, you can look at the source code.
  10. I have 2 sprite groups each representing a hand of cards. Each group has its own scale, rotation and position; same for each sprite (card) in each group. I'm trying to create a smooth animation of the card moving from one hand to the other. I can calculate the local parameters (scale, rotation and position) of where the card should be in the new group, but I can't seem to find an easy way to create a tween between 2 sets of local parameters. The only route I could think of at the moment is something along the lines of: store '', 'sprite.worldScale' and 'sprite.worldRotation' => remove sprite from group => add sprite to temporary group => set temporary group's parameters to the stored world parameters => calculate the world parameters in the new group => tween to new world parameters => add sprite to new group and set it to its local parameters. The becomes even more difficult if the destination could potentially change during the tween. Is there an easier or a more robust way of achieving that?
  11. Phaser Blank White Screen

    I am trying to create my first game with phaser but Im running into the issue of a blank white screen. I dont see any issue with my code and Im running a local server with wamp. Their isnt any errors in the console, but no matter what I change the code nothing will appear on the screen. Thank you for your help. main.js index.html
  12. Shoot a rope

    Hi, I started recreating an arcade game called Pang and have a javascript version (1st level) here I'd like to use Phaser to continue the development but am stuck on how to animate the weapon (a metal rope with a spearhead). I'd tried using the Phaser.Rope class but am struggling to understand how to do the following: Add a spearhead to the end of the rope Animate the rope from the player's position to the top of the screen Start the animation when the user presses fire (spacebar) if anyone could give me any pointers, I'd be eternally grateful!
  13. [Phaser] The Last Battery

    Hi! I Just released my new game called "The Last Battery"! You can play it for free at and try to survive until your battery is running out! Also, my other games are at Thanks!
  14. Make tilemap/world fit in game?

    Hi, I just learned some basics of using tilemaps. I created a tilemap using Tiled, containing 32x32px tiles. The problem is, I can't resize the entire tilemap to fit the entire canvas. I need the layer in the tilemap or the world itself to fit the canvas. scale.setTo() works, but that's relative and I want to set the width and height to that of the game's canvas. Changing displayWidth and width doesn't seem to have any effects. The tilemap still appears small in the upper left corner of the canvas. Any suggestions guys? Code: var playLevel = { create: function() { ='tilemap');'sewer', 'sewerTileset'); //Need to make this layer larger by a specified amount this.groundLayer ='Ground');, 200, true, 'Ground'); this.groundLayer.resizeWorld(); }, update: function() { } } EDIT: I just found out that changing width and height DOES work. But for some reason, instead of the tilemap's width being 32 * 20 = 640, it returned 940, which is the width of the canvas. But the tilemap itself looks to be 640 pixels wide, so I don't know why the width and height properties don't correspond to the actual ones. So I guess I can't use it?
  15. Best Typescript/Phaser IDE?

    A couple years ago a built an Asteroids clone using JS and Phaser on Cloud9 ( Was a great experience and a great way to learn JS. I'm now looking at a second game that I'd like to code with Typescript and distribute on the Android platform and possibly iOS. C9 has since been bought by Amazon and not supporting the C9 IDE as much. Regardless, it never supported breakpoints for JS, so had to debug using the Chome dev tools. My day job is coding C++ on visual studio. What's the best IDE for coding Typescript for Phaser? Ideally (for me) it would be close to Visual Studio experience (e.g., eclipse) but I'm up for something different. Mostly, I'd like to get away from the clunky C9 / Chome debugging.
  16. [WIP][Phaser] Xmas delivery game

    Merry Christmas, everyone I am working on a christmas themed single button game. The player drops gifts to house chimneys. Player gets points (+10) if a good boy receives a gift (for now this means hitting the chimney once of a one-storied or two-storied beige house) and 0 otherwise. Game time is limited. Current version is here: In the future I plan to: - add the ability to drop 2 gifts at one house (you can drop one for now); - add 2 more house types (e.g. a house where 2 good boys live); - make the appearance of different house types more clear, so the player could decide more quickly whether it’s good for him to drop gifts at the forthcoming house and how many (1 or 2); - disable gifts throw for a while if the player makes mistakes (e.g. hits a roof or throws 2 gifts to bad boys); - add extra points for sharpshooting, e.g. +30 for 3 subsequent throws to a good boy; - add levels, levels will differ by house types quantities and player speed; - add roof break animation; - change font, change the way ttf fonts load; - rewrite all modules to ES-2015, build assets with some task runner, optimize assets load, make game work on mobile devices. Any feedback will be appreciated, maybe you have some suggestions about game art, instructions text, game mechanics, or performance.
  17. How This Will work?

    I think I will use time loop event and some rndX but i confused how to implement it to my code. I want the rock sticky on the platform so i use phaser arcade mode I want to make it but have no idea. Can anyone help me? Any help will be appreciate
  18. Hey there! I am using the latest Phaser.js from the official website. I am creating a game that is supposed to be 640x480 in size. var game = new Phaser.Game(640, 480, Phaser.AUTO, '', { preload: preload, create: create, update: update }); But the final canvas that is being rendered is 800x600 in size, which would be correct according to my Windows DPI settings of 125% (640*1.25=800, 480*1.25=600). A resolution of 1280x720 will get scaled up to 1600x900 and as a result, everything will look blurred. The website itself is not zoomed in or enlarged in any way using Chrome. How do I disable this "feature"? I want to be able to control the size of the game.
  19. Enqueue tweens?

    I have sprite that is animated on a board, let's say a 4x4 grid. If the user presses a button, it will move either one one square up/down or left/right. If the user presses the button multiple times, I want for it to step through the movements but as it is right now the sprite will just move diagonally to the final state. Is there a way to enqueue tweens so that each step runs asynchronously? Here's what the transition from one state to another looks like now, where state is the current state number and the location arrays hold the points at every state: game.add.tween(sprite).to({ x: locationX[state], y: locationY[state]}, 500, Phaser.Easing.Linear.None, true);
  20. Phaser-CE + AngularCLI boilerplate This is a super bare bones, hello world app using Angular-CLI and phaser-ce. Thought someone might find it useful
  21. I'm working on puzzle game about a professor trapped in hamster's body Current prototype is hosted on gamejolt Please try it and give me a feedback on the following issues: - Are controls responsive and intuitive? Whether it could be a good idea to use keyboard controls for desktop version? - Is gameplay boring? - Are puzzles tough? You can follow development process on gamejolt devlog Or in my twitter @kpded
  22. Collision mask in Phaser

    hi guys, Why there is no collision mask (like in construct 2d) in phaser.I think that will be a good feature.
  23. Basic Phaser Game Example - ECMA2015

    I've been updating my base projects in-line with ECMA2015 standard. There is a lot of good stuff I really enjoy in this. I think the use of classes really makes code more easy on the eyes and easier to manager. I've created a base project using the Basic Game example tutorial using some of the new stuff. BasicPhaserGameECMA2015 I've not setup the menu or gameover states, but that should be simple enough. Hope you guys get some use out of it.
  24. emmmm, how can I stretch part of an image(or a sprite)? As you can see, from 1.png to 2.png, just stretch the mid part. Thank you all.
  25. retry level button not working

    hi, I've been using phaser for some time now but am having some issue with my game when I press the restart button. My game goes into an infinite loop and my player can't jump as high as he used to before. Its like as if gravity increased on the stage. and other objects disappear too like they go all the way down to the screen Can somebody tell me whats wrong here retry: function () { //this.clearCurrentState() this.levelSong.pause() this.winSong.pause() this.gameOverSong.pause() this.shutdown()'Level2') }, shutdown:function() { }, here is the link to my game (My problem is in level 2):