Understanding SFSTris example
Posted: 09 Nov 2010, 01:13
Hey, im trying to understand the logic of the example provided.
It seems i have a basic problem understanding how you guys separate the game logic between each room.
you declare few variables under the main class SFSTrisGame
one of them is a single instance of the gameboard
under the init function you instantiate the board which mean we only have 1 instance of that board
now i guess what im trying to understand is this : When users create different room games, they use the same gameBoard instance in the server? or this variable is initiated for each room?
It seems i have a basic problem understanding how you guys separate the game logic between each room.
you declare few variables under the main class SFSTrisGame
one of them is a single instance of the gameboard
Code: Select all
private TrisGameBoard gameBoard;
under the init function you instantiate the board which mean we only have 1 instance of that board
Code: Select all
public void init()
{
gameBoard = new TrisGameBoard();
}
now i guess what im trying to understand is this : When users create different room games, they use the same gameBoard instance in the server? or this variable is initiated for each room?