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

  1. Hi, I'm creating a node js game, using javascript and socket io. I originally was not going to add a mongo DB, but now I'm thinking I should for anyone who may accidentally be disconnected from the game. What would the best game option be? To use a database or not, and the reasons behind it. Many thanks, MLA
  2. Hello everyone So i am making a game where the server sends which sprites to create on the client's view. So i can't load those sprites util the server sends an object with which sprites to show. The code is as follows: in the server this.emit("newSprites", newPlayer); in client socket.on("newSprites", addSprites); function addSprites (data){ sp = data this.add.sprite(58, 84, sp.name) } This will result in an error Uncaught TypeError: Cannot read property 'sprite' of undefined I know that this is in reference to 'this'. because "this" is the function not create part of Phaser. In Phaser 2 that line would start with game.add.sprite. But i don't know what to call it in Phaser 3. Any help would be appreciated. thanks
  3. 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??
  4. mla

    (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?
  5. 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
  6. 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