point limit parametrized
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user