Search the Community

Showing results for tags 'phaser'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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,916 results

  1. [Phaser] Zombie Cannon Attack!

    Zombie Cannon Attack! is a zombie-themed endless runner, with cannons! Cannon-fire test zombies to infect the local populace and create your very own rampaging zombie horde. Gather data and use it to upgrade your zombies and build the perfect undead army. Available now on Play Store, download FREE here: https://play.google.com/store/apps/details?id=com.rubblegames.zombie_cannon_attack Created using Phaser, and packaged for Android with Cordova. For further details see this blog post. I'd appreciate any comments or feedback, and a download and rating on the Play Store would be fantastic. I'm also happy to answer any questions anyone might have. UPDATE: I've recently released a Halloween update to the Android version. There's also now a web demo on Kongregate and Gamejolt, Gamejolt also has a downloadable desktop version.
  2. Hello! In Phaser ( particularly Phaser CE ) I can't find something like Wind Resistance for objects. And start thinking how to implement my own version: create(){ game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.gravity.y = 100; this.car = game.add.sprite(32, 32, "car"); game.physics.p2.enable(this.car,false); this.car.body.windResistance = 0.4; } update(){ if(this.car.body.windResistance && this.car.body.velocity.y > this.car.body.windResistance ){ this.car.body.velocity.y-= this.car.body.windResistance; } } With this I can't use big numbers for windResistance, only between 0 and 1. What do you guys think??
  3. A.I Egg

    So, just a little project created while building a few functions and stuff I'll need for later projects. Turned out pretty good for what I wanted, but later I'll go back to improve a few more things. A bit too plain right now, but gets the job done. Play in the browser, mobile or desktop: http://umzgames.com/itcn/aiegg
  4. This is my latest game - Dreams vs Nightmares http://build.games . Nightmares are attacking fluffy Catnap and dreams defend it. The game is in Plants vs Zombies style with 6 levels of gameplay. I'm planing to add more levels and introduce some new defenders or attackers each level. Any ideas are welcome Dreams vs Nightmares are build with Phaser. And I used online collaboration tool MyGameBuilder. Also there is a community contributing with pixelart and music which was quite handy for me. Btw, link to a project if you find it interesting https://v2.mygamebuilder.com/u/guntis/projects/Dreams vs Nightmares?_fp=chat.P_fSriL4uw2W4kY8Liu_ Printscreen from intro animation Some action in last levels
  5. [Phaser] Copter Rescue

    Hello fellow game devs, I have made this game Copter Rescue in the recent few weeks, you can check it out on the this link: http://goo.gl/sCcnu2 Also contacted a few HTML5 game publisher and hoping that I will get a few offers for exclusive or non-exclusive licence, what do you think would be a fair price for a game like that? Thanks for your answers and your time. Feel free to discuss the game and what you like/dislike, I'm open to any kind of criticsm. Regards!
  6. My Game Builder allows you to make games with JavaScript, Phaser, or no code at all. You can pull up your workstation from anywhere, at anytime, and work together on projects. There is real time "google docs" style collaboration. Any game you see can be viewed with full source to see exactly how every part was put together, and forked to make your own "mod" of it or to just mess around. Tutorials are included for art, programming, or whatever else you want to brush up on. http://build.games
  7. Hi guys, just a quick question. I'm trying to detect overlap between emitter particles and a group like so: create: function() { this.emitter = this.game.add.emitter(0, 0, 1000); this.emitter.enableBody = true; this.emitter.makeParticles('whiteParticle'); this.emitter.minParticleSpeed.setTo(100); this.emitter.maxParticleSpeed.setTo(800); this.emitter.gravity = 50; this.emitter.maxParticleScale = 3; this.emitter.minParticleScale = 0.1; this.emitter.setYSpeed(-150, 150); this.emitter.flow(1500, 100, 100, -1, false); //lifespan, frequency, quantity, total, immediate this.emitter.checkWorldBounds = true; this.emitter.outOfBoundsKill = true; this.fire = this.game.add.group(); this.fire.enableBody = true; this.fire3 = this.game.add.sprite(1423, 500, 'fireL3'); this.fire2 = this.game.add.sprite(1423, 500, 'fireL2'); this.fire1 = this.game.add.sprite(1423, 500, 'fireL1'); this.fire.add(this.fire3); this.fire.add(this.fire2); this.fire.add(this.fire1); }, update: function(){ this.game.physics.arcade.overlap(this.emitter, this.fire, this.damageFire, null, this); } damageFire: function(){ console.log('fire damaged!'); }, I can get this to work fine if I check for overlap between 2 sprites/groups, but I cannot get it to work for the emitter. Could anyone point me in the right direction? Thanks
  8. I'm still in the early prototyping phase so I suspect (hope?) my issue is one of overlooking a core tenant of Phaser... Also, I'm coding with Phaser CE 2.8.7 using Typescript/ES6. My primary game state is comprised of two classes: A combat class extending Phaser.Sprite which serves as a container for the 4 character atlases within, and, beneath, a UI Class extending Group which contains a few buttons and, to the right, a mini-map group comprised of a Tilemap and its lone TilemapLayer. (The star icon is a simple sprite on top of the tilemap layer which will later represent the player, but that is currently inactive.) The problem: as the characters advance to the right there's no problem until the camera kicks in. It "follows" the sprites just fine... BUT while advancing the camera seems to erase the tilemap layer as it goes, removing it entirely. When the characters return to the start position, however, the mini-map is restored as the camera passes from right to left. If I remove the camera altogether this never occurs, so it seems I've mismanaged the camera or the mini-map somehow. I've attached two screenshots: the first displaying the mini-map before the camera begins to erase it, the second as the camera begins to pass above the mini-map, erasing the image as it passes. I'll gladly provide any relevant code if needed...
  9. Hey guys, I was profiling my game and it seems like I could save some cpu time if I could bypass this function call in my objects' postUpdate : postUpdate: function() { ... if (this.components.PhysicsBody) { Phaser.Component.PhysicsBody.postUpdate.call(this); } ... } My question is, since my game doesn't use any physics at all, do I have to rebuild phaser without physic support? Or is there a simpler way to simply disable the creation of physics body on all my game objects? Thanks for any input!
  10. I'm using this example. Phaser always calls contact callback twice when using tilemaps (i think, it works well on examples without a tilemap). var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.tilemap('map', 'assets/tilemaps/maps/collision_test.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('ground_1x1', 'assets/tilemaps/tiles/ground_1x1.png'); game.load.image('walls_1x2', 'assets/tilemaps/tiles/walls_1x2.png'); game.load.image('tiles2', 'assets/tilemaps/tiles/tiles2.png'); game.load.image('ship', 'assets/sprites/thrust_ship2.png'); } var ship; var map; var layer; var cursors; function create() { game.physics.startSystem(Phaser.Physics.BOX2D); game.stage.backgroundColor = '#2d2d2d'; map = game.add.tilemap('map'); map.addTilesetImage('ground_1x1'); map.addTilesetImage('walls_1x2'); map.addTilesetImage('tiles2'); layer = map.createLayer('Tile Layer 1'); layer.resizeWorld(); map.setCollisionBetween(1, 9); game.physics.box2d.convertTilemap(map, layer); ship = game.add.sprite(200, 200, 'ship'); game.physics.box2d.enable(ship); ship.body.setCircle(14); // CONTACT CALLBACK BEGIN ship.body.setCategoryContactCallback(1, function(b1,b2,f1,f2,begin){if (begin){console.log(b2);}}); // CONTACT CALLBACK END game.camera.follow(ship); game.physics.box2d.setBoundsToWorld(true, true, true, true, false); cursors = game.input.keyboard.createCursorKeys(); game.add.text(5, 5, 'Use arrow keys to move.', { fill: '#ffffff', font: '14pt Arial' }); } function update() { if (cursors.left.isDown) { ship.body.rotateLeft(300); } else if (cursors.right.isDown) { ship.body.rotateRight(300); } else { ship.body.setZeroRotation(); } if (cursors.up.isDown) { ship.body.thrust(300); } else if (cursors.down.isDown) { ship.body.reverse(300); } } function render() { // game.debug.box2dWorld(); }
  11. communication between classes

    Hi there, I'll explain a bit what I mean by the title I have a Game state with two different classes A & B on them. Both A & B are sprite extensions. A is a completely autonomous being, working with a state machine, and has no idea if any object of the B class exists. B instances are simply items placed statically on the world. In some of the FSM events, A needs to know where an intance of B is located, so it can move to that location to finish it's current action, all without leaving A's bounds. In simple words: I need to submit a request from A to B so that B returns an attribute value. Right now I was trying using Phaser's signals to do so, as I can dispatch the signal from A to make a callback function in B fire but is there any way to retrieve the return value of the callback function? Right now, a signal from A fires the callback function on B perfectly, but it gives me an undefined value on the console. A simplyfied code of what I mean: /* class game */ var Game = function(){ this.A; this.B; } Game.prototype.create = function(){ this.A = new A(); this.B = new B(); this.A.events.someAction.add(this.B.getSomeAttribute, this.B); } /* class A */ var A = function(){ ... this.events.someAction = new Phaser.Signal(); } A.prototype.constructor = A; A.prototype.someFunction = function(){ ... this.events.someAction.dispatch(); // how to retrieve return value? ... } /* class B */ var B = function(){ someAttribute = someValue; } B.prototype.constructor = B; B.prototype.getSomeAttribute = function(){ return someAttribute; } Am I understanding anything wrongly? it's there a better way to work around this? I'm using Phaser 2.6.2. Any help will be much appreciated
  12. RPG Dialogue System

    Hello, guys, I am trying since days to find an easy working solution for my game project. I want to add a simple dialogue system, similar to this of Pokémon, with just a dialogue box and some text appearing in it. Unfortunately, there is no tutorial which could explain or help me out with this, or I am not able to find one I got a .json file with all the dialogues (attached) and I want to call them into my actual state. For entering the dialogue I have already this, but the text wouldn't be displayed update: function(){ game.physics.arcade.collide(monk, buildings2_noWalk1, function(){console.log('buildings2');}); game.physics.arcade.collide(monk, buildings1_noWalk1, function(){console.log('buildings1')}); game.physics.arcade.collide(monk, mountains_nowalking1, function(){console.log('mountains');}); // Activate Dialogue Mode if(enter.isDown){ game.paused = true; //set game paused } // Set Dialogue if(game.paused){ console.log("Dialogue"); game.add.text(100, 100, "Test"); } Could someone help me out? I really just want it in a simple way, no complex scripting. Thanks a lot Best wishes Moonware dialogue.json
  13. Performance problems on switching tabs

    Hello guys, I have some big problems with the performance by switching tabs and the rendering progress. Maybe some of you can help me. (Sry for my english I give my best.) The game about I'm talking is to find under: https://dsbmg.de/slotdemo/app.html It's a slotmachine I build. The big problem is, that some users would like to play the game in more than one tab and some tabs are in background sometimes. Thats why I done the following. The backend is a php file which is doing the whole math and connecting to the database to save player-data for each bet and other things. Then there is a webworker as middleware which communicates with the backend and the frontend builded with phaser. If a user switch the tab, a javascript code recognize the visibiltychange event and then send the new state to the middleware. The middleware itself take this event and switch internal from visible to none-visible and sending a break to the frontend that kills the tweens if there are some. After that point the middleware just "taking" to the backend with a delay, like the slot would be rendering, but without doing anything. (in autoplay mode) After switching the tab back to the front from the background, the visibiltychange event sending a message from the frontend to the middleware which switches the intern state to visible and the next game starting rendering again. But at that point the tweens and updates are not running well. They make a lot of problems which I can't figure out. Do anyone of you have an idea what I can do better? Have you any idea what I can do to get a better performance? If the slot is just running in one tab (background or front) there seems to be no such problems, just if you open another tab with the game. Hope you can help me to build a better engine for the slot.
  14. Collison not working properly for me

    I am trying to make a simple game with this super cool engine. But I am facing some issues regarding the collisions i have setup. Can anyone please help me on this. Code Link:: https://github.com/Vikas00kr/Dodge
  15. This is my newest project with Phaser, 2D platformer which aims to bring the best from the present and the past in one game. Curentlly it is still WIP but you can see how the development progress is moving on. Some of you may have seen it on twitter but for those who didn't here are a few gifs: As far as tools and frameworks are concerned I'm using: Phaser - for coding Aseprite - for pixel art Tiled -for level design I'm alone working on this game, graphics, programming and design, so if you see any flaws please do not hesitate to criticize me. Cool part about being solo dev beside not having anyone to mess with my ideas is that when I get bored doing programming, I draw assets for my games, when I run out of inspirations for drawing I design levels, when get tired with that I move back to programming and so on! I hope that playable demo will be available by the end of the month. Thanks everyone for taking a look. Cheers!
  16. Image Not Displaying in Phaser

    I'm following the rougelike tutorial and for some reason the preloader images arent displaying. I load them in the boot state: preload() {//changed the file names to make it easier to type this.load.image('preloaderBackground', 'assets/progBarBack.png'); this.load.image('preloaderBar', 'assets/progBar.png'); this.game.state.start('Preloader'); }and i try to display them here: module RougeLikeClone { export class Preloader extends Phaser.State{ background: Phaser.Sprite; preloadBar: Phaser.Sprite; create() { this.stage.backgroundColor = "#FF0000"; //just to check this.background = this.add.sprite(this.game.width / 2 - 250, this.game.height / 2 - 70, 'preloaderBackground'); this.preloadBar = this.add.sprite(this.game.width / 2 - 250, this.game.height / 2 - 70, 'preloaderBar'); } }} I get a red background with a greenoutlined black box when this runs. Whats the problem? (see attatched)
  17. Handle diagonal car ramp

    Greetings from a newbie in Phaser. In a 2d car game, how do you imagine a car ramp? Is there any way to draw a diagonal object and when the car object hits that start decreasing the angle and increasing the position.y? Progress! I started with Phaser.Physics.P2JS ( had to quit using Phaser.Physics.ARCADE ) Then make an sprite and assigned a Polygon: preload(){ this.load.physics('physicsData', '/app/dist/sprites.json'); } create(){ game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.gravity.y = 50; game.physics.p2.defaultRestitution = 0.01; ramp = game.add.sprite(100, 100, 200, 100, "block"); game.physics.p2.enable(ramp); ramp.body.clearShapes(); ramp.body.loadPolygon('physicsData', 'ramp'); } My sprites.json is: { "ramp": [ { "density": 2, "friction": 0, "bounce": 0, "filter": { "categoryBits": 1, "maskBits": 65535 }, "shape": [ 200, 0 , 200, 100 , 0, 100 ] } ] } I think I got it. Any advice is good
  18. 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. http://gamejolt.com/games/fruitspritzer/273499 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.
  19. Hi Guys, I'm having some issues with an emitter that I am trying to attach to a sprite using the addChild method. The emitter should be a child of the player's arm so that it moves and rotates correctly. When I add the emitter to the game without being added as a child it works fine. As soon as I add it as a child to the arm it disappears from the game world. I've played around with a bunch of different coordinates in case it was being moved slightly off screen but I've come to the conclusion that something is going wrong here. I've also run tests in a new state with just a single sprite and an emitter and as soon as I add the emitter asChild of the sprite it is gone. I'm probably missing the thing that is going wrong here, so any help would be appreciated. I'll put my code snippet below if that helps at all create: function() { this.game.stage.backgroundColor = "#000"; this.playerContainer = this.game.add.sprite(300, 600, null); this.player = this.game.add.sprite(0, 0, 'player'); this.player.scale.setTo(0.75); this.backArm = this.game.add.sprite(-10, -180, 'backArm'); this.backArm.scale.setTo(0.75); this.frontArm = this.game.add.sprite(-10, -180, 'frontArm'); this.frontArm.scale.setTo(0.75); this.emitter = this.game.add.emitter(0, 0, 5000); this.emitter.makeParticles('whiteParticle'); this.emitter.minParticleSpeed.setTo(200, 0); this.emitter.maxParticleSpeed.setTo(2000, 0); this.emitter.gravity = 200; this.emitter.lifespan = 0; this.playerContainer.addChild(this.backArm); this.playerContainer.addChild(this.player); this.playerContainer.addChild(this.frontArm); this.frontArm.addChild(this.emitter); this.game.physics.arcade.enable(this.playerContainer); this.game.physics.arcade.enable(this.player); this.playerContainer.body.collideWorldBounds = true; this.player.anchor.setTo(0.5); this.frontArm.anchor.setTo(0.4866, 0.2925); this.backArm.anchor.setTo(0.4866, 0.2925); },
  20. [Phaser] Sky Kid Mini

    Hi, Sky Kid Mini is new HTML5 version of legendary Sky Kid game form mid 80's (https://en.wikipedia.org/wiki/Sky_Kid). Fly as far as you can, avoid obstacles and use collected stars to unlock all 5 different planes. Play the game here: http://www.bandainamcoent.fun/ww/html5gameplay/f0762cddd94f66e78f507fd63ebdad10/game/sky-kid-mini#2
  21. Ajax inside phaser not working

    Hello I'm just trying to get a simple ajax function to work inside phaser just to play around with it. But I can't seem to get it to work. The function is just supposed to send two variables to PHP and get back a sentence where those two variables are part of it. But I only get the basic sentence back. And I have tried to use the function outside phaser with just an onclick bottom function, and their it works fine. So it must have something to do with phaser. heres the code in phaser And here is the php I have a sprite where i use the events.onInputDown.add function. But i only get While when i just use a botton in html and plane javascript i get
  22. Hi folks. Been messing around with Phaser again, and I've got a question. How do I grab both the directory AND file name FROM an ALREADY LOADED XHR file, OR the file name AND directory from a 404'd XHR? I want to use an asynchronous function to grab what's in the console XHR file tab and store it in either in an array or a string for later use. Thanks a ton! ~Mythros <3
  23. I have to add lengthy instructions (3 pages, with examples and images, possibly with one animated GIF) to a game I'm building using Phaser framework. The instructions will be shown by clicking "Instructions" button on the game title page (title state). How do you usually do that? Should I use bitmapText for paragraphs of instructions? I'm thinking about showing them in html format in a DIV the same size of the canvas with canvas hidden behind it. What is more practical? Any suggestions?
  24. gunfight.io

    Hi Everyone, GunFight.io - original HTML5 multiplayer game. Select your team Counter-terrorists or Terrorists and have fun! Play Made with: Phaser + NodeJS server framework - custom version of Colyseus scheduled to add: 1) Multi-language support 2) May be bots? 3) Mobile device support. 4) More emotions. Any suggestion and feedback are welcome.
  25. Problems in Landscape mode

    Hi everyone!, I've just started to use Phaser's framework, so I don't have enought knowledge about it. I did a game (test it here), it works well on pc's browser. The problem were when I tried to do it mobile friendly. I tried to do that (on boot's state): if (!game.device.desktop) { game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.scale.refresh(); } When I test it in my phone (portrait mode) it works good . The problem is when I rotate the screen (landscape mode), it doesn't scale well(I can't see the bottom). Portrait view: Landscape view: (I can't see the bottom) What is the problem ?? Thanks!!