need to have games track width/height
This commit is contained in:
parent
b800f77c24
commit
0396b16425
5
game.go
5
game.go
@ -14,13 +14,14 @@ type game struct {
|
|||||||
unregister chan *player
|
unregister chan *player
|
||||||
robot_id chan int
|
robot_id chan int
|
||||||
turn int
|
turn int
|
||||||
|
width, height float64
|
||||||
spectators map[*Spectator]bool
|
spectators map[*Spectator]bool
|
||||||
sregister chan *Spectator
|
sregister chan *Spectator
|
||||||
sunregister chan *Spectator
|
sunregister chan *Spectator
|
||||||
kill chan bool
|
kill chan bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGame() *game {
|
func NewGame(width, height float64) *game {
|
||||||
return &game{
|
return &game{
|
||||||
register: make(chan *player),
|
register: make(chan *player),
|
||||||
unregister: make(chan *player),
|
unregister: make(chan *player),
|
||||||
@ -28,6 +29,8 @@ func NewGame() *game {
|
|||||||
splosions: make(map[*splosion]bool),
|
splosions: make(map[*splosion]bool),
|
||||||
players: make(map[*player]bool),
|
players: make(map[*player]bool),
|
||||||
turn: 0,
|
turn: 0,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
spectators: make(map[*Spectator]bool),
|
spectators: make(map[*Spectator]bool),
|
||||||
sregister: make(chan *Spectator),
|
sregister: make(chan *Spectator),
|
||||||
sunregister: make(chan *Spectator),
|
sunregister: make(chan *Spectator),
|
||||||
|
Loading…
Reference in New Issue
Block a user