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 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 3,282 results

  1. Hey guys, I'm new to phaser and I'm not quite sure if this is a bug or a mistake of myself. In this code if the player has a circle as his body and if he is colliding with one of this obstacles he won't get separated as it is described in the phaser documentation. So if you move up and collide with the obstacle the console starts printing out true even if you stop moving. In addition to that if you walk against an edge of the obstacle the player gets stuck on it and can't get away of that. I'm confused because this doesn't happen if the players body is an rectangle. Does anybody have an idea? var game = new Phaser.Game(600, 600, Phaser.AUTO, "", {preload: preload, create: create, update: update}); var player; var cursors; var obstacles; function preload(){ game.load.image("robot", "player.png", 32, 48); game.load.image("obstacle", "box.png"); } function create(){ player = game.add.sprite(game.world.centerX, game.world.centerY + 200, "robot", 5); game.stage.backgroundColor = 'rgb(239, 228, 176)'; game.physics.arcade.enable(player); player.body.setCircle(player.width/2);// player don`t get seperated in the collide function //player.body.setSize(player.width * 0.8, player.height*0.8,player.width * 0.1, player.height*0.1 ); //player get seperated in the collide function player.anchor.set(0.5); player.angle = -90; cursors = game.input.keyboard.createCursorKeys(); obstacles = game.add.group(); game.physics.arcade.enable(obstacles); obstacles.enableBody = true; obstacles.create(game.world.centerX, game.world.centerY - 200, 'obstacle'); obstacles.create(game.world.centerX - 190, game.world.centerY - 200, 'obstacle'); obstacles.create(game.world.centerX + 150, game.world.centerY - 100, 'obstacle'); obstacles.create(game.world.centerX - 130, game.world.centerY, 'obstacle'); obstacles.create(game.world.centerX - 230, game.world.centerY, 'obstacle'); obstacles.setAll('body.immovable', 'true'); obstacles.setAll('anchor.x', '0.5'); obstacles.setAll('anchor.y', '0.5'); } function update(){ game.debug.body(player); obstacles.forEach(function(item) { game.debug.body(item); }); if (cursors.up.isDown) { game.physics.arcade.velocityFromAngle(player.angle, 200, player.body.velocity); } else { player.body.velocity.set(0); } if (cursors.left.isDown) { player.body.angularVelocity = -300; } else { if (cursors.right.isDown) { player.body.angularVelocity = 300; } else { player.body.angularVelocity = 0; } } game.physics.arcade.collide(player,obstacles,(p1,en)=>{ console.log(true); }, null, this); } cheers landa
  2. In this multiplayer game tutorial series with Node.js server and Phaser client, it goes over room logic, and implementing maximum number of players. http://gojasonyang.com/post/phaserMultiplayerGamePart6.html
  3. Thunderfist

    I can't find the bugs in my code

    I have a problem: I'm making an RPG and it's not working. I just keep getting a green bar on a white screen. I have multiple .js files, and I can't figure out which file might be it.
  4. jevisan

    Sound effects mashed up

    Hi , i'm having a difficulty while trying to play sounds on player input. The character is supposed to move and play a footstep sound while doing so. But the sound is really short and end up restarting the sound every call to update which causes it to sound mashed up. Is there any way i could fix this? The code isn't really that much relevant but still: update: function() { if (this.cursors.left.isDown) { this.player.body.velocity.x = -this.player.speed; this.player.animations.play('walk-left'); this.footstepA.play(); } } Oh and i would also like to reproduce another footstep sound after playing that one. Like so: footstepA, footstepB, footstepA, etc.
  5. game_prince

    multiplayer online card game

    hello i want to make a online multiplayer online card game using phaser. CAn you please help me in this that from where i would start??
  6. I have a global object called "params" that stores a lot of important parameters for my game. I define params in a "main.js" file that initializes the game, defines my states and parameters, and then calls my "bootState". For some reason, when I restart my "gameState" (another state, defined in "gameState.js") it resets my "params" object to the values it was initialized with in "main.js". My goal is to change some parameters via "params" in the console, then restart "gameState" and have it reflect those changed parameters. If needed I can provide some example code.
  7. I've started writing a generator for Phaser 3 typescript definitions using Richard's JSDoc annotations. If anyone is interested in helping: https://github.com/troyedwardsjr/phaser3-tsd
  8. Hello for 2 years now I have been developing games mostly using Java`s and libGDX or/and openGL, but now im very interested in Phaser for web-based game development and I think that is a very powerful tool. I have no problems with game logic but when i come up with render logic in Phaser I need to know if there are possibilities for: 1 Pixel to World unit conversion. ex: In libGDX I can work in 8x6 world units game instead of using pixels units (640*360 for exmaple) , that helps me to write a lot better logic 2 Multiple cameras in the same scene 1 camera for game and more than one for the HUD .
  9. smdool

    init parameters is undefined

    In Phaser 2.7.5 I'm trying to pass an object as a parameter from one state to another but the object is showing as undefined. Below is the code from GameState whereby I'm looking to pass an object containing a score, time and seconds. this.game.state.start( "Congratulations", true, false, { score: this.killedGerms, time: this.timeLabel.text, seconds: this.remainingSeconds }); Below is the CongratulationsState where the parameter, "data", is coming through as "undefined". init: function(data) { console.log('data', data); data = data || { score: 0, time: "00:00", seconds: 0 }; } Any ideas on where I have gone wrong would be greatly appreciated.
  10. Hi, Our company develop simulations of aircraft systems. We are looking for developers that use Phaser Editor, and has knowledge of Typescript or Javascript and Phaser. Also we will provide you our own framework for developing easier and faster. It's a fully freelance job and we will give you only deadline. Payment method is open to negotiation. You can check our examples here: http://www.flycoglobal.com/B737schematics/ExteriorLightingLocations/ http://www.flycoglobal.com/B737schematics/BleedAirSystem/ http://www.flycoglobal.com/B737schematics/HydraulicPowerDist/
  11. madmarcel

    Phaser + Spriter - collision boxes

    Hi, Been trying to get Spriter Pro collision boxes to work in Phaser - has anyone had any luck in getting this to work? I'm close...but not quite there... This is using this plugin by the way: https://github.com/SBCGames/Spriter-Player-for-Phaser
  12. Hello all. I am having a browser-specific issue with Phaser 2.10.0 that I cannot seem to understand. I have the following code for a button. minDimension = Math.min(game.width, game.height); resetButton = game.add.sprite(game.width * 0.5, game.height * 0.925, 'Reset'); resetButton.anchor.setTo(0.5, 0.5); resetButton.width = resetButton.height = minDimension * 0.075; resetButton.inputEnabled = true; resetButton.events.onInputDown.add(resetProcess, this); This puts a reset button image at the middle of the bottom of the browser window. As expected, when clicked or tapped, the resetProcess() function is called and the level in my game is reset. This works as expected in most browsers on desktop and mobile; however, in Android Chrome (in my case, Android 7.0.0 and Chrome 64.0.3282.137) the button appears but does not do anything when clicked. I verified that the issue is not in my resetProcess() function. It seems that the onInputDown event isn't working properly. I also tried the following code, using a button instead of an image. minDimension = Math.min(game.width, game.height); resetButton = game.add.button(game.width * 0.5, game.height * 0.925, 'Reset', resetProcess, this); resetButton.anchor.setTo(0.5, 0.5); resetButton.width = resetButton.height = minDimension * 0.075; This caused behavior identical to the snippet above. Previously, a few months ago, I was able to get my button working as expected no matter the browser, and no changes were made to this part of my code since then. Does anyone have any thoughts as to what might be causing this issue, and how to fix it? Thanks.
  13. Hi, i'm having a problem with the collisions in my game. I'm using tilemap layers the character can jump as long as it's not touching the ground, but the moment it touches the tiles that are set for check for collision, it just seems unable to move upwards. Can move sideways tho. Everything else is loaded and displayed just fine. BasicGame.Game = function (game) {}; BasicGame.Game.prototype = { create: function () { this.game.physics.startSystem(Phaser.Physics.ARCADE); this.setUpInput(); this.setUpMap(); this.setUpPlayer(); }, update: function () { this.processPlayerInput(); this.processCollisions(); }, /*==========================CREATE ASSOCIATED FUNCTIONS==========================*/ setUpInput: function() { // arrow keys this.cursors = this.input.keyboard.createCursorKeys(); }, setUpPlayer: function() { this.player = this.add.sprite(BasicGame.PLAYER_SPAWN_X, BasicGame.PLAYER_SPAWN_Y, 'player'); this.player.anchor.setTo(0.5, 0.5); this.game.physics.arcade.enable(this.player); this.camera.follow(this.player); this.player.speed = BasicGame.PLAYER_SPEED; this.player.jump_speed = BasicGame.PLAYER_JUMP_SPEED; this.player.body.collideWorldBounds = true; this.player.body.gravity.y = 1000; }, setUpMap: function() { this.map = this.game.add.tilemap('testLevel'); this.map.addTilesetImage('lvl_1_tiles', 'level1_tiles'); // collisionable layer this.collisionLayer = this.map.createLayer('collisionable'); this.map.setCollisionBetween(1, 2000, true, this.collisionLayer); this.collisionLayer.resizeWorld(); }, /*==========================UPDATE ASSOCIATED FUNCTIONS==========================*/ processCollisions: function() { this.game.physics.arcade.collide(this.player, this.collisionLayer); }, processPlayerInput: function() { // reset movement this.player.body.velocity.x = 0; ... // jumping <== it should jump but it doesnt!!! if (this.cursors.up.isDown) { this.player.body.velocity.y = -this.player.jump_speed; this.player.frame = 2; } } }; { "height":10, "infinite":false, "layers":[ { "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 0, 0, 9, 0, 14, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 18, 0, 0, 0, 0, 0, 0, 14, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 14, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], "height":10, "name":"collisionable", "opacity":1, "type":"tilelayer", "visible":true, "width":20, "x":0, "y":0 }], "nextobjectid":1, "orientation":"orthogonal", "renderorder":"right-down", "templategroups":[], "tiledversion":"2017.10.31", "tileheight":32, "tilesets":[ { "columns":5, "firstgid":1, "image":"..\/tilesets\/lvl_1_tiles.png", "imageheight":256, "imagewidth":160, "margin":0, "name":"lvl_1_tiles", "spacing":0, "tilecount":40, "tileheight":32, "tilewidth":32 }], "tilewidth":32, "type":"map", "version":1, "width":20 }
  14. So i bought the Particle Storm Plugin to get more Particle effects and stuff, pretty awesome... but i'm still a newbie in terms of Particle Emitters and how to produce the best result with them. So many variables and options that by slightly changing them can change the result a lot. I'm trying to add a little smoke/dust trail behind my character when i start running. Sounds simple, huh? So i made a plain squared white 20x20 texture to use it as the particle asset. this.manager = this.game.plugins.add(Phaser.ParticleStorm); let dust = { image: 'dust', blendMode: 'NORMAL', lifespan: { min: 100, max: 200 }, scale: { min: 0.3, max: 2 }, vy: { value: { min: 0, max: 0.1 } }, vx: { value: { min: 0, max: 0.1 } }, rotation: { value: 0, delta: { min: -2.0, max: 2.0 } } }; this.manager.addData('dust', dust); this.emitter = this.manager.createEmitter(); this.emitter.addToWorld(); Then inside the update() function, i track my character's position, is not properly done, though... since it's quite offset. But is just to try it out first. this.emitter.emit('dust', this.x, this.y - 10, { total: 1, frequency: 600 }); The problems i'm encountering is that it feels like particles are going way too fast. I couldn't find a way to slower them down, tried using `frequency`, but emits soo many particles per second that is unrealistic for this specific scenario. I would like to emit for instance, 3 to 5 particles at once, make them rotate a little and change their size (scale) ... with ofc short lifespan otherwise trail will be huge. Another good idea (probably) would be if they kinda fadeOut while lifespan is about to finish. Any help is appreciated.
  15. ddabrahim

    Hosting multiplayer games?

    Hi. I'm currently developing a single player game in Phaser and occurred to me to make it online multiplayer instead but I would prefer not to run my own server and wondering what solutions are out there for hosting online multiplayer games? I searched the web and did come across 4 solutions. PlayerIO, AppWarp, Photon and using platforms like Heroku and Amazon.... At the moment I'm more likely go with PlayerIO because the pricing is better, the free package allow me to get started with no obligations and the paid packages also seems cheap compared to other hosts but I would like to get some feedback if it any good or not, should I consider using something else? I would be grateful for any opinion on this or even links to articles I could learn something from. Thank you.
  16. I have created tilemap using Tiled software of pixel size 1200x1000. While rendering it using phaser I have set width equal to 500 and height equal to 400.After this only map of 500x400 area is loading and remaining part is missing. How can I show the full map in 500x400 area on my webpage?
  17. lucasdavidferrero

    The Canvas doesn't show sprites

    Hi community, I'm having a problem with canvas and sprites. I'm new in this matter and I hope that you could help me The problem, as the title says, is that I can't see the sprites on canvas. I've tried to call the functions preload() and create() manually in the browser's console and I get a warning that says: Phaser.Cache.getImage: Key "bg" not found in Cache. The warning appears for every Key that I'm using for. There is my code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Cat Catcher</title> <script src="./js/phaser.min.js"></script> <script> var game = new Phaser.Game(800, 600, Phaser.CANVAS, {preload: preload, create: create, update: update}); var cat, catcher, cursors, txtScore, score; function preload() { // load assets game.load.image('cat', '/img/cat.png'); game.load.image('catcher', '/img/cat.png'); game.load.image('bg', '/img/bg.png') } function create() { //setup game game.add.sprite(0, 0, 'bg'); catcher = game.add.sprite(400, 300, 'catcher'); catcher.anchor.setTo(.5,0); game.physics.enable(catcher, Phaser.Physics.ARCADE); cat = game.add.sprite( Math.random() * game.width, Math.random() * game.height, 'cat' ); game.physics.enable(cat, Phaser.Physics.ARCADE); score = 0; var style = { font: '20px Arial', fill: '#FFF' }; txtScore = game.add.text(10, 10, score.toString(), style); cursors = game.input.keyboard.createCursorKeys(); } function update() { //game loop code if(cursors.left.isDown){ catcher.x -= 5; catcher.scale.x = 1; } if(cursors.right.isDown) { catcher.x += 5; catcher.scale.x = -1; } if(cursors.up.isDown) { catcher.y -= 5; } if(cursors.down.isDown) { catcher.y += 5; } game.physics.arcade.overlap(catcher, cat, catHitHandler); } </script> </head> <body> </body> </html> I'm using Phaser v2.10.0 I wish you could tell me where the problem is, Thanks!
  18. Play Link: Pixel Memory Find all card pairs, level your profile & unlock new cards in this “Memory” classic optimized for mobile! Play Link: Pixel Memory Welcome to the "Memory" classic, expanded with new features & optimized for mobile! Game Features: Play the “Memory” classic in this mobile game. 3 Difficulties: Easy, Medium & Hard. Level up your profile & unlock more cards. Browse your collection to see which cards you’ve already unlocked. 4 card deck skins: Choose the one you like best! View your profile for your game stats & best scores in all difficulties. Gameplay: Find all the matching card pairs on the table. Find them before you run out of guesses. Unlock all the card packages in the game. Controls: The whole game requires only click inputs and is perfectly optimized for mobile! Credits: The game was developed solely by me. All assets in this game were either done by me or from the CC0 assets linked below. These sources are also credited inside the game: Play Button Name: Cartoon Mobile Rounded Icon Buttons Author: Nathan "GDquest" Lovato, https://opengameart.org/users/gdquest, http://gdquest.com/ URL: https://opengameart.org/content/cartoon-mobile-rounded-icon-buttons Explosion Sprite: Name: 2D Explosion Animations #2 | Frame by frame Author: Sinestesia, https://opengameart.org/users/sinestesia, http://www.sinestesiastudio.com/ URL: https://opengameart.org/content/2d-explosion-animations-2-frame-by-frame http://bit.ly/2C6Bi8b Audio: http://www.freesfx.co.uk/sfx/ Play Link: Pixel Memory
  19. I am developing a game where I need to zoom in entire map also I can be able zoom out. I have created a tilemap using tiled software and rendered it using phaser.js. How can I add this function to my game?
  20. Play Cool Math

    1024 Math

    1024 Math Remix on classic game 2048. 1024 Math reminds a game of 2048 from Gabriele Cirulli. There are 18 levels in this game. You need to complete all the goals when you get at each level. https://playcoolmath.com/en/math-games/1024-math Play 1024 Math
  21. Many 2D even 3D frameworks now support Spine. Even Phaser 2.6.2 has a plugin for Spine, thanks to Orange Games. So do you plan integrating Spine in Phaser 3?
  22. anskotid

    Using Phaser together with React

    I am trying to understand how I could use React for rendering all the UI elements and Phaser for rendering a game (using Canvas or WebGL) within the React application. One way would be to use React's componentDidMount, so after I have my HTML ready I can use a div id to render the Phaser content. But in this case React does the game rendering too. Is there any way to achieve the desired result?
  23. brainbass

    Firefox Slow FPS

    Hello, Since some day, firefox turn phaser game slow. All game i have created and even litle game downgrade fps. (60FPS to 30FPS) I dont know where is the problem. i have try use phaser but no change. You can try with this example : https://phaser.io/examples/v2/time/slow-down-time if you wait some seconds the animation down to 30fps. this problem is only on firefox (i suppose since v57). All others browsers working fine. Have you an idea where is the problem? Thank you
  24. I am developing a game where my player has to look to see forward when I am pressing right arrow key. But how can I make it look reverse after pressing left arrow? I can create a sprite of reverse look but how can load that while pressing left and at the same time forward player should be destroyed?
  25. Hi, I'm syed and i'm new for phaser. how to add restitution for one object not for whole world Note: using P2JS physics engine