Search the Community

Showing results for tags 'socket io'.



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

Found 4 results

  1. 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??
  2. (On Disconnect) Last player hangs

    I have a multiplayer game that assigns and displays an avatar for each player that accesses the game. When a player leaves the game, it will drop the image so the avatar is no longer on screen. This works - sort of. Here is the problem: Ex: Three players access the game, three avatars are created. Then one player leaves, that avatar is removed from screen. The other two players leave, and for some reason, the last avatar remains on screen. So the host will always see that last avatar sitting there. I'm using splice to remove the players. I check my array and all players dropped from the array. It shows []. I have no clue how that avatar is still there. Is there a way to completely remove that socket.id from the game?
  3. Hi, I have been struggling with a minor issue, that I'm hoping someone can help me out with. I have a multiplayer game that uses Express and Socket io. When a new player logs into the game, the player walks to a certain location on screen. In order to make the player walk, I am drawing the player to canvas using a spirit map. In order to make the player walk per frame I am using the ctx.clearRect() to clear the previous frame, however doing this naturally clears the full canvas and removes the already logged player. I'm not sure how to work around this. Any insight is greatly appreciated. Thanks, Laura server.js Player.js
  4. Hey everyone! I've build a little game with phaser a while back and i'm currently adding a play online feature. My main problem at the moment is how to handle two players colliding. The players are supposed to bounce off of each other. In the non-mulitplayer game, this is how I handle the collision. this.game.physics.arcade.collide(this.player, this.player2, this.playerCollide, this.beforePlayerCollide, this);with the collide functions as follows: beforePlayerCollide:function(player1,player2){ player1.body.bounce.setTo(1,1); player2.body.bounce.setTo(1,1); return true; },playerCollide:function(player1,player2){ if(!this.hitSound.isPlaying){ this.hitSound.play(); } player1.body.bounce.setTo(0,0); player2.body.bounce.setTo(0,0);}For multiplayer, i'm currently just sending the other user's position and velocity on every movement through socket io and updating his position and velocity on the fly. I will deal with optimizing this method and accounting for lag later, but at the moment I just need to get the basic game to work. The problem here is that due to constant update of the player positions, the playerCollide function sometimes doesn't trigger after the beforePlayerCollide, causing the players to just have their bounce setting turned on. Has anyone faced this problem before? Should I change the way i'm making the players bounce off each other on collision? Or is there no way that this will work with constantly updating the opponents position? Any help would be appreciated, thank you