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.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 2,784 results

  1. Hi Guys, I have developed a game using Phaser js. In which I have added a intro video.In iPhone while playing the video it opens it on the default video player(with fullscreen).Is it possible to block default player to open? Anyone help me. Thanks, Sakthi
  2. Hello, I have just finished the third level for my html5 game, Adventure of Ryan Hunter. Please check it out and let me know what do you think. Thank you, Priyo Hutomo
  3. Hello, I'm using Phaser for a school project. were making a 2d platformer game. I have multiple states for different levels. The transition works fine, next level is displayed properly, enemies function as the should, everything scrolls, but the keyboard stops recognizing input. right now i have: this.cursors = this.input.keyboard.createCursorKeys(); in the create function of both Level.js and Level2.js but they are not working for level 2. i have also modified the create cursor keys function in phaser.js to add a few key codes so now it reads like this: return this.addKeys({ 'up': Phaser.KeyCode.UP, 'down': Phaser.KeyCode.DOWN, 'left': Phaser.KeyCode.LEFT, 'right': Phaser.KeyCode.RIGHT, 'ctrl':Phaser.KeyCode.CONTROL, 'shift':Phaser.KeyCode.SHIFT, 'alt':Phaser.KeyCode.ALT, 'enter':Phaser.KeyCode.ENTER}); Basically wondering what i should be doing different to get keyboard input recognized in multiple states. i tried doing the game.input.resetLocked=true; in the create functions of either level.js or level2.js, it either did nothing (for level2) or stopped the game from running (for level1)
  4. Hello, I am new to Phaser. What is the best way to create scene (menu, top, settings, game itself) for puzzle game? Should I create scene manually (code) or should I use some GUI and export results as JSON file which later I can use in Phaser? Thanks in advance and I hope my question was not answered hundreds times
  5. Releasing a Phaser game

    Hey guys, I'm about to release a game made with Phaser 2.8.2 targeting Desktop browsers. I was wondering if there's anything I need to do to make sure the code runs as optimized/smooth as it can on players browser? In native world, I would simply create a "release" type build with compiler optimizations enabled. Is there such a thing? Thanks.
  6. Alien Invasion

    Hello everyone I'm creating a new game and I have the basics working. It would be really nice to hear what you think. The game is still under construction but you should be able to play the first level of each mission I am working on the next levels. It is still under construction but i hope to be able to create a fully working version. here is the link:
  7. Fruit Spritzer is a WIP match3 (Candy Crush, Bejewelled) style game. Simple mechanic, fun, fast paced, score as much as possible in 60 seconds. High scores are recorded online, thanks to GameJolt. Swipe to swap neighbouring fruits, 3 matched fruits squish, longer matches result in bonus combos, that when matched result in super-squishes: Explode - squish all fruits surrounding the match in all directions. Slicer - squish all fruits in the row/column from the match. Blender - squish all fruits of the same type as the match, matches with any fruit type. Match two bonus combos for surprise super-combos. Unlike many match3 games, the engine doesn't prevent interaction while the previous match is still running. Because time is of the essence, Fruit Spritzer allows you to continu making matches even while fruit are dropping and chain reactions happening, resulting in frantic and challenging gameplay. Think quickly, move fast, score high.
  8. Camera shake black bars problem

    Hi, I have a problem with camera.shake(). It shakes the screen instead of moving the camera and black bars appear. In this example, it works fine. What am I doing wrong? Im using Phaser 2.8.3 CE if (player.weapon.canFire) { var bullets =;, 400); }
  9. Hello I'm new in HTML game development. Want to create a website that will contain a 2D scoreboard in order to be viewed in Smart TV Web Browsers. I've just create a simple prototype with Phaser 2.4.2 but it didn't work out although used Phaser.CANVAS option in Phaser.Game constructor. Web browser supports Canvas but does not support WebGL. Opera web browser on Linux. Is it possible to make Phaser run? Or are there any other proper html game engines i can use to build my website? Thanks.
  10. Hi, I updated phaser lib from older version to 2.6.2 and now there is no more "alpha" property in "sprite" object. I see "alpha" is still available using tween. But what if I want to change it directly like it was in previous version? : this.background = this.add.sprite(0, 0, 'back'); this.background.alpha = 0; thanks
  11. Ladder

    510/5000 Good night people! I'm developing a game where the character needs to climb a ladder. The problem I am facing is when he needs to enter a tile that is down the ladder, as I try to illustrate in the image below. When hitting the tile the pesonagem stops to move because the tile needs to be solid so the character can walk on it, but when he is on the stairs he must pass over this tile. Could someone show an example of how I can do this? Since then, thank you very much.
  12. Hello comrades, I'm new to phaser and I can't seem to create new objects to the group "capetinhas", even though I can load the sprite through game.add.sprite. Here's the code: var game = new Phaser.Game(448, 448, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload () { game.load.image('tabuleiro','assets/tabuleiro.png') game.load.spritesheet('devil','assets/devil.png',32,32); var capetinhas; } function create (){ capetinhas =; game.add.sprite(window.width,0,'tabuleiro');//loading the background game.add.sprite(128,128,'devil'); // this works capetinhas.create(32,32,'devil'); // this doesnt } function update (){ } Any helpe would be really apreciated. Thanks in advance.
  13. Phaser lags after 2 minutes

    Hi, I downloaded the following from Why is it everytime I played the game in the chrome browser/firefox after 1 minute it started to become laggy, Thanks <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Basketball Game</title> <script type="text/javascript" src="js/phaser.js"></script> <h2>Basketball Game (inspired by Facebook Messenger!)</h2> <style type="text/css"> body { margin: 0; } canvas { margin: 0 auto; border: thin solid black; } span { display: block; margin: 30px auto; width: 500px; text-align: center; } h2 { text-align: center; } </style> </head> <body> <script type="text/javascript"> // NOTE: Originally 640x1000. Other possible sizes: 512x800, 400x625 var game = new Phaser.Game(400, 625, Phaser.CANVAS, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('ball', 'assets/images/ball.png'); game.load.image('hoop', 'assets/images/hoop.png'); game.load.image('side rim', 'assets/images/side_rim.png'); game.load.image('front rim', 'assets/images/front_rim.png'); game.load.image('win0', 'assets/images/win0.png'); game.load.image('win1', 'assets/images/win1.png'); game.load.image('win2', 'assets/images/win2.png'); game.load.image('win3', 'assets/images/win3.png'); game.load.image('win4', 'assets/images/win4.png'); game.load.image('lose0', 'assets/images/lose0.png'); game.load.image('lose1', 'assets/images/lose1.png'); game.load.image('lose2', 'assets/images/lose2.png'); game.load.image('lose3', 'assets/images/lose3.png'); game.load.image('lose4', 'assets/images/lose4.png');'score', 'assets/audio/score.wav');'backboard', 'assets/audio/backboard.wav');'whoosh', 'assets/audio/whoosh.wav');'fail', 'assets/audio/fail.wav');'spawn', 'assets/audio/spawn.wav'); } var hoop, left_rim, right_rim, ball, front_rim, current_score = 0, current_score_text, high_score = 0, high_score_text, current_best_text; var score_sound, backboard, whoosh, fail, spawn; var moveInTween, fadeInTween, moveOutTween, fadeOutTween, emoji, emojiName; var collisionGroup; function create() { game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.setImpactEvents(true); game.physics.p2.restitution = 0.63; game.physics.p2.gravity.y = 0; collisionGroup = game.physics.p2.createCollisionGroup(); score_sound ='score'); backboard ='backboard'); backboard.volume = 0.5; whoosh ='whoosh'); fail ='fail'); fail.volume = 0.1; spawn ='spawn'); game.stage.backgroundColor = "#ffffff"; // high_score_text = game.add.text(450, 25, 'High Score\n' + high_score, { font: 'Arial', fontSize: '32px', fill: '#000', align: 'center' }); current_score_text = game.add.text(187, 312, '', { font: 'Arial', fontSize: '40px', fill: '#000', align: 'center' }); // 300, 500 current_best_text = game.add.text(143, 281, '', { font: 'Arial', fontSize: '20px', fill: '#000', align: 'center' });// 230, 450 current_best_score_text = game.add.text(187, 312, '', { font: 'Arial', fontSize: '40px', fill: '#00e6e6', align: 'center' }); // 300, 500 hoop = game.add.sprite(88, 62, 'hoop'); // 141, 100 left_rim = game.add.sprite(150, 184, 'side rim'); // 241, 296 right_rim = game.add.sprite(249, 184, 'side rim'); // 398, 296 game.physics.p2.enable([ left_rim, right_rim], false); left_rim.body.setCircle(2.5); left_rim.body.static = true; left_rim.body.setCollisionGroup(collisionGroup); left_rim.body.collides([collisionGroup]); right_rim.body.setCircle(2.5); right_rim.body.static = true; right_rim.body.setCollisionGroup(collisionGroup); right_rim.body.collides([collisionGroup]); createBall(); cursors = game.input.keyboard.createCursorKeys(); game.input.onDown.add(click, this); game.input.onUp.add(release, this); var instructions = document.createElement("span"); instructions.innerHTML = "Instructions: Quickly drag the ball to shoot the ball into the hoop!"; document.body.appendChild(instructions); } function update() { if (ball && ball.body.velocity.y > 0) { front_rim = game.add.sprite(148, 182, 'front rim'); ball.body.collides([collisionGroup], hitRim, this); } if (ball && ball.body.velocity.y > 0 && ball.body.y > 188 && !ball.isBelowHoop) { ball.isBelowHoop = true; ball.body.collideWorldBounds = false; var rand = Math.floor(Math.random() * 5); if (ball.body.x > 151 && ball.body.x < 249) { emojiName = "win" + rand; current_score += 1; current_score_text.text = current_score;; } else { emojiName = "lose" + rand;; if (current_score > high_score) { high_score = current_score; // high_score_text.text = 'High Score\n' + high_score; } current_score = 0; current_score_text.text = ''; current_best_text.text = 'Current Best'; current_best_score_text.text = high_score; } emoji = game.add.sprite(180, 100, emojiName); emoji.scale.setTo(0.25, 0.25); moveInTween = game.add.tween(emoji).from( { y: 150 }, 500, Phaser.Easing.Elastic.Out, true); fadeInTween = game.add.tween(emoji).from( { alpha: 0 }, 200, Phaser.Easing.Linear.None, true, 0, 0, false); moveInTween.onComplete.add(tweenOut, this); } if (ball && ball.body.y > 1200) { game.physics.p2.gravity.y = 0; ball.kill(); createBall(); } } function tweenOut() { moveOutTween = game.add.tween(emoji).to( { y: 50 }, 600, Phaser.Easing.Elastic.In, true); moveOutTween.onComplete.add(function() { emoji.kill(); }, this); setTimeout(function () { fadeOutTween = game.add.tween(emoji).to( { alpha: 0 }, 300, Phaser.Easing.Linear.None, true, 0, 0, false); }, 450); } function hitRim() {; } function createBall() { var xpos; if (current_score === 0) { xpos = 200; } else { xpos = 60 + Math.random() * 280; }; ball = game.add.sprite(xpos, 547, 'ball'); game.add.tween(ball.scale).from({x : 0.7, y : 0.7}, 100, Phaser.Easing.Linear.None, true, 0, 0, false); game.physics.p2.enable(ball, false); ball.body.setCircle(60); // NOTE: Goes from 60 to 36 ball.launched = false; ball.isBelowHoop = false; } var location_interval; var isDown = false; var start_location; var end_location; function click(pointer) { var bodies = game.physics.p2.hitTest(pointer.position, [ ball.body ]); if (bodies.length) { start_location = [pointer.x, pointer.y]; isDown = true; location_interval = setInterval(function () { start_location = [pointer.x, pointer.y]; }.bind(this), 200); } } function release(pointer) { if (isDown) { window.clearInterval(location_interval); isDown = false; end_location = [pointer.x, pointer.y]; if (end_location[1] < start_location[1]) { var slope = [end_location[0] - start_location[0], end_location[1] - start_location[1]]; var x_traj = -2300 * slope[0] / slope[1]; launch(x_traj); } } } function launch(x_traj) { if (ball.launched === false) { ball.body.setCircle(36); ball.body.setCollisionGroup(collisionGroup); current_best_text.text = ''; current_best_score_text.text = ''; ball.launched = true; game.physics.p2.gravity.y = 3000; game.add.tween(ball.scale).to({x : 0.6, y : 0.6}, 500, Phaser.Easing.Linear.None, true, 0, 0, false); ball.body.velocity.x = x_traj; ball.body.velocity.y = -1750; ball.body.rotateRight(x_traj / 3);; } } </script> </body> </html>
  14. Define Game Scaling at Boot

    Hi, Just wondering if it is possible to define the scaling for a game only once in a single state (rather than in every state) and it is applied to all states thereafter? In the game I'm currently making I have a boot state and I want to define the scaling only once in the init function but it doesn't seem to apply to any following states and I have to define these settings on all pages: This is the code I'm using for scaling if it helps at all: init: function() { this.scale.pageAlignHorizontally = true; this.scale.scaleMode = Phaser.ScaleManager.USER_SCALE; this.scale.setUserScale(0.445, 0.445, 0, 0); }, I'm sure I must be missing something obvious. Any help would be appreciated.
  15. How make a fight game

    Hi guys, I am newbie on making games, and I chose Phaser to start with. So I'd like to make a fight game but I can't find any exemple or tutorial that could help me with it. Someone have a tip or something, or is better choose other framework for this?
  16. correct vertical allign

    Hello, I tried many different ways but cannot make text appear vertically centered. Anchor is working fine, the problem is within font itself. When I use number as text, there is invisible space (I can see that if I set background color) bellow base line (for example letter g). However in my case this is critical, because number (score) is shown within small circle and must be ideally centered. 1) The complicated solution could be getting actual text height by scanning canvas' pixels. However, this may be time consuming. 2) Currently the only fast solution seems to be, creation of BitMap font with numbers. Is there any better solution than this? Thanks in advance
  17. Hi there, I'm Alexander the CEO of SOFTGAMES. Based in Berlin, the creative capital of Europe, SOFTGAMES is the world’s largest producer and distributor of HTML5 games. We’re delivering fun to millions of users every month across 6 continents on the device of their choosing. Our vision is to help users to instantly discover and engage with games they like, while helping brands to reach their target audiences. We're Facebook Instant Games launch partner (plus several other messengers and social networks) and are now looking for a super-talented, self-motivated and passionate Senior Game Developer to join us. At SOFTGAMES you have the chance to join a small team of super talented people to build awesome HTML5 games using Phaser that will entertain millions of people. The position is full-time and based in our Berlin office. The Senior Game Developer role is responsible for building great games from beginning (prototyping) to the end (launch). You will work closely with artists and game producers to deliver a great player experience and with other Game Developers to share learning and best practices. The successful candidate will ship robust and high performance code, is proactive, and act as a fount of knowledge when it comes to game development. As part of a small game team you will enjoy a creative, challenging and collaborative environment and are expected to have the entrepreneurial spirit with a “getting things done” attitude. Interested? Then I'm looking forward to your application ( or PM me your CV! Best, Alexander
  18. Hi guys, We developed a game last year with phaser 2.3.0 and webgl, it worked fine on computer browsers and mobile devices. But since the last update of chrome for android (v53.0.2785.97), the screen is flickering until it becomes totally black, without any error or warning. The issue is present on mobile only, it worked on chrome for android v52, but not v53. We tried to upgrade to phaser 2.6.2, same issue on chrome for android v53. If we use Phaser.CANVAS instead of webgl, it works fine, but we prefer using webgl for performances. Does anyone encounter the same problem? Thanks for your help. Joe K.
  19. I try to start it with this example : I use download zip , but seam need to fix a php server. I try to fix by using just the files and folder to run the example that but seem is not working . Can you give me some help ? Thank you. Best regards.
  20. [WIP][Phaser] Color Stars

    Hello devs! I want to share with you the first demo of Color Stars, It's a color puzzle flat game with an educational component. The game will be available on web and mobile (cocoon) Play here: I appreciate your feedback and comments Thanks UPDATE Add some "modifiers or traps" Speed fixed New planets added The game is almost ready, thanks to people who helped me testing it.
  21. [LD39]Oppressiv Light

    Hi! I gathered a small team to participate in this summer's Ludum Dare. We managed to build a functional game with Phaser so here's the link: Oppressiv Light Pitch: You're a robot lost in an abandoned spaceship, most of the lights have faded out and there's an alien that lurks in the dark. You can frighten him with your embedded lamp, but beware to not run out of power! (you can charge your lamp by reaching the lit areas) Find the switch that will get the lights back in the whole level and proceed to the next . If you want to give us a feedback about the game, the best place would be on its Ludum Dare's submission page (but you need an account to do so), or just write here or on the page, I'll read it anyway. You can also view the source code on it's GitHub repository, but it's pretty messy...
  22. In the game "Monster Wants Candy," I see this in the source code, and I was wondering why this was done. I've tried doing this myself but keep failing. This is what I mean: var Candy = {}; Candy.Boot = function(game){}; Candy.Boot.prototype = { preload: function(){ // preload the loading indicator first before anything else this.load.image('preloaderBar', 'img/loading-bar.png'); }, create: function(){ // set scale options this.input.maxPointers = 1; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true); // start the Preloader state this.state.start('Preloader'); } }; (source: var gameWidth = 800, gameHeight = 600; var game = new Phaser.Game(gameWidth, gameHeight, Phaser.AUTO), BootState = function () {}, gameOptions = { playSound: true, playMusic: true }, musicPlayer; BootState.prototype = { preload: function () {'loadingbar', 'assets/images/loadingbar.png');'logo', 'assets/images/logo2.png');'LoadState', 'js/gamestates/LoadState.js');'pollyfill', 'js/lib/pollyfill.js');'utils', 'js/lib/utils.js'); }, create: function () { game.renderer.renderSession.roundPixels = true; Phaser.Canvas.setImageRenderingCrisp(;'LoadState', LoadState);'LoadState'); } };'BootState', BootState);"BootState"); I also note that I don't take "Game" as an argument in my game state functions, unlike Monster Wants Candy which has the argument "game" in it's bootstate. Have I been doing something wrong? I'm following most of the tutorials and example code I've seen so far, though I am aware those may not always be good examples of best practice. Thanks in advance for replies and sorry for the long post. I'm a bit of a JS and Phaser noob, I'm mainly just aiming to learn good practice with this project.
  23. Hi Guys, I've recently started using Phaser and I'm developing a game to be used in a web browser on PC and mobile. The game has to be displayed in a specific frame size (853 x 480). The game will also have a full screen button that would then scale the game to the user's device window. I have the assets for the game created at 1920 x 1080 and I would like to use them in the game by using Phaser's scaling methods. I have found lots of resources on how to scale the game world to the user's device for full screen but I cannot find a way to scale the game to a specific frame size. Here is where I initialise a new Phaser game. = new Phaser.Game(1920, 1080, Phaser.AUTO, 'game'); The plan is to create the game at 1920 x 1080 and add all the assets to the screen and then resize the game world to 853 x 480. To achieve this, I've tried: this.scale.setGameSize(853, 480); But this doesn't resize any of the assets within the game, only the game window. Do I need to add all the game assets to a group and then scale from there? Another way I could do this is to simply use two different sets of assets, those to be used in the fixed sized window and then when the user goes full screen it would pull the 1920 x 1080 assets and scale them accordingly. I feel like I might be missing something really obvious though, so any help would be appreciated. Thanks

    Hi All We developing girl games by HTML5. If yo have any requirements for developing games do PM us. Also we have some games for sale. Looking to hear from you. thanks Sherin
  25. Game list of phaser games

    Edit by Rich (September 2016): Back in 2013 Mike created a web site (below) that allowed Phaser devs to list the games they'd made. You'll find over 400 games created with some of the earliest versions of Phaser. Lots of the links don't work any more, but some do, and it's a really interesting archive. It's not worth submitting your games to the list any longer, however I'm keeping it, and this thread, because people still post new games to this thread even today. If you do this, it's highly likely I'll see it, and add it to the Phaser web site. Mike's original message follows: ------------------------------------------------------------------------------------------------------------------- What I did started from personal need, but decided to share it and maybe improve it if it went bigger. Well since the engine is still new but there is quite a moving and I check every topic, and game that is made I have a phaser game list: