I know I can' learn about game coding overnight and I don't mean to take anyone's time, but I DO want to keep trying to program a 4 player game. A two team card game.
I have googled trying to find info or tutorials but I can't find a site with a clear tutorial or hints I can base myself on so I am trying to get started with the 2 player games that come as examples with SF. I have modified the PRO tris example and the first major problem I'm encountering is that my game isn't visible until the third try.
I figured it would be about modifying the internal event handler in the extension and added 2 more players in there like this:
Code: Select all
if (u.getPlayerIndex() != -1)
{
numPlayers++;
if (u.getPlayerIndex() == 1)
{
p1id = u.getUserId();
}
else if (u.getPlayerIndex() == 2)
{
p2id = u.getUserId();
}
else if (u.getPlayerIndex() == 3)
{
p4id = u.getUserId();
}
else
{
p4id = u.getUserId();
}
if (numPlayers == 4 && !gameStarted)
{
startGame();
}
}
The player's index id's are correct and the start game function will trigger properly as soon as the 4 players are there, but, like I entitled the post (or thread - excuse my english) I have to test the swf 3 times before any other player sees the game room. The rest of the extension file is attached.
Thanks