point limit parametrized

This commit is contained in:
sm
2013-11-29 01:10:49 -07:00
parent 33aea792ed
commit 3bb710dd9c
5 changed files with 39 additions and 32 deletions
+4 -1
View File
@@ -57,6 +57,7 @@ type game struct {
turn int
players_remaining int
width, height float32
maxPoints int
spectators map[*Spectator]bool
sregister chan *Spectator
sunregister chan *Spectator
@@ -67,7 +68,7 @@ type game struct {
winners WinnerMap
}
func NewGame(id string, width, height float32, obstacles, tick int) *game {
func NewGame(id string, width, height float32, obstacles, tick, maxPoints int) *game {
g := &game{
id: id,
register: make(chan *player),
@@ -80,6 +81,7 @@ func NewGame(id string, width, height float32, obstacles, tick int) *game {
turn: 0,
width: width,
height: height,
maxPoints: maxPoints,
spectators: make(map[*Spectator]bool),
sregister: make(chan *Spectator),
sunregister: make(chan *Spectator),
@@ -90,6 +92,7 @@ func NewGame(id string, width, height float32, obstacles, tick int) *game {
players_remaining: 2,
winners: WinnerMap{m: make(map[string]int)},
}
log.Printf("NewGame: %+v", g)
return g
}