anchor.diff:  -export([init/2, pending/2, started/2]).
   
   %% state rec
  --record(state, {
  -				game_sup,
  +-record(state, {game_sup,
  +				input_sup,
  +				gold_sup,
  +				entity_sup,
   				game_event,
   				game_id,
  -				players
  -  				}).
  +				map_graph,
  +				collision_tab,
  +				players}).
   
   %%====================================================================
   %% Public functions
  
positive.code: %%====================================================================
  
  init(GameId, BcGameSup) ->
  	{ok, GameEventPid} = supervisor:start_child(BcGameSup, #{
  		id => bc_game_event,
  		start => {gen_event, start_link, []},
  		modules => [gen_event]
  	}),
  	{ok, pending, #state{game_sup = BcGameSup,
  						 game_event = GameEventPid,
  						 game_id = GameId,
  						 players = dict:new()}}.
  
  pending({player_join, #{player_pid := PlayerPid, 
  						handle := Handle}},
  		State = #state{game_sup = BcGameSup,
  					   game_event = GameEventPid,
  					   game_id = GameId,
  					   players = Players}) ->
  	case save_player(GameId, Handle) of
  		{ok, PlayerId} = Reply ->
  			erlang:monitor(process, PlayerPid),
  			gen_event:notify(GameEventPid, {player_joined, PlayerId, Handle}),
  			gen_event:add_handler(GameEventPid, {bc_game_event, PlayerId}, 
  								  {player_pid, PlayerPid}),
  			UpdatedPlayers = dict:store(PlayerId, PlayerPid, Players),
  			UpdatedState = State#state{players = UpdatedPlayers},
  			case pending_players_changed(GameId, UpdatedPlayers) of
  				{ok, started} ->
  					gen_event:notify(GameEventPid, {game_started, dict:to_list(Players)}),
  					{reply, Reply, started, UpdatedState};
  				{ok, pending} ->
  					{reply, Reply, pending, UpdatedState};
  				{error, Reason} = Error ->
  					gen_event:notify(GameEventPid, {game_error, Reason}),
  					gen_event:stop(GameEventPid),
  
negative.code: 					case win_game(GameId, InPlayer#player.id) of
  						{ok, won} ->
  							gen_event:notify(GameEventPid, 
  											{game_won, InPlayer#player.id, InPlayer#player.handle}),
  							gen_event:stop(GameEventPid),
  							{stop, won, State};
  						{error, Reason} = Error ->
  