Jump to content

Search the Community

Showing results for tags 'socket io'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 7 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. Hi, I have a nodjs application that is currently saved in Windows 2012 R2 server using IISnode with IIS 8.5. I am getting a 404 File or directory not found error, however nothing is being recorded in the error logs. When I run this locally I have no issues and the game runs well. Thinking it could be a permissions issue, I decided to provide temporary read/write access, however that didn't seem to make a difference. I also confirmed that the links are all correct in terms of where files are sitting. Here is my server side code: var PORT = process.env.PORT || 8080; var express = require('express'); var app = express(); var http = require('http'); var path = require('path'); var util = require("util"); var server = require('http').createServer(app); var compression = require('compression'); //Get required classes xyLocation = require("./xyLocation").xyLocation; app.use(compression()); //Compress all routes app.use('/client', express.static(__dirname + '/client')); app.use('/js', express.static(__dirname + '/js')); app.use('/css', express.static(__dirname + '/css')); app.use('/sounds', express.static(__dirname + '/sounds')); app.use('/images', express.static(__dirname + '/images')); // Routing app.get('/', function(request, response) { response.sendFile(path.join(__dirname, 'index.html')); }); server.listen(PORT); console.log('Starting server on port '+ PORT); var io = require('socket.io')(server,{}); io.sockets.on('connection', function(socket) { ... Thanks MLA
  3. 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
  4. 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
  5. 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?
  6. 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
  7. 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
×
×
  • Create New...