Implement multiple players #5
Description
I want to implement a support for multiple players:
In firebase I want to have multiple games located in the root
of the firebase database, and every game
has several properties, for example maxPlayers
, the gameId
and the map
as a String which allows all users to generate the same map. Furthermore each game
should contain an players
array, which container a player
object with some properties like top
, left
, rotation
, which all specify the tanks transformation
.
The structure should look something like this:
{
--firebaseKeyGame1: {
maxPlayers: 6,
gameId: "Ghe7de",
map: "[[[140,true,false,false,true], ...",
players: {
0: {
top: 20,
left: 180,
rotation: 45
},
1: { ... },
...
},
--firebaseKeyGame2: { ... },
...
}
and you should be able to select a game
from tmp-game
and push it down to tmp-map
, in tmp-map
you should loop over all players
to get all players displayed on the map
NOTE: already started this issue on multiple-players and multiple-players2