Sorry to come late to the party, but I have the same issue and I'm new to developing here. So I need a little more help, and apologies in advance it those are obvious to all except me...
First:
concerning "$this->gamestate->changeActivePlayer( $player_id )", where should I code my "changeActivePlayer" method, simply in "mygame.game.php", inside my "mygame" class ? Then why not call "$this->changeActivePlayer()" (what is "gamestate" doing in there) ?
Then:
I need to randomize the first player at some key points in the game. Is there an API for this in the framework ? (since I assume the framework is doing the randomization for us at the start of the game, I thought maybe this service is available somewhere)
Thanks in advance,
Pierre