Jump to content

Multiplayer Help: Player screens occasionaly end u differrent


IamThatGuy
 Share

Recommended Posts

I dont know where to start trying to get this problem fixed. It only allows 2 people per game so I am assuming when a certain player sends there move. The other player is not receiving it.

 

http://runechart.com:3000/newBlock.html

 

 

 

On another note, different browsers are executing the code faster then others. IE will drop my blocks faster then Google Chrome. This is unrelated to the problem about synching the players moves, because I been doing the testing with the same browser. Of course when I use 2 different browsers, the boards get totally screwed up since the blocks are falling at different speeds on each browser.

var the_date = new Date();var test1 = the_date.getTime();var stamp = the_date.getTime() + 200;function game_loop() {	the_date = new Date();	test1 = the_date.getTime();	if(stamp <= test1)	{		if(player_move[0] != "")		{			Player1.checkMoveBlock(player_move[0]);			player_move[0] = "";		}		if(player_move[1] != "")		{			Player2.checkMoveBlock(player_move[1]);			player_move[1] = "";		}		the_date = new Date();		stamp = the_date.getTime() + 200;		//move/drop/destroy blocks		Player1.execu();		Player2.execu();		}	Player1.render();	Player2.render();		// request new frame	requestAnimFrame(function()	{	  game_loop();	});} 
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...