Renamed obstacle -> obstacle count
This commit is contained in:
parent
2a9c178ebb
commit
db28bfea11
@ -20,7 +20,7 @@ type Config struct {
|
|||||||
Delta float32 `json:"delta"`
|
Delta float32 `json:"delta"`
|
||||||
Width int `json:"width"`
|
Width int `json:"width"`
|
||||||
Height int `json:"height"`
|
Height int `json:"height"`
|
||||||
Obstacles int `json:"obstacles"`
|
ObstacleCount int `json:"obstacle_count"`
|
||||||
MaxPoints int `json:"max_points"`
|
MaxPoints int `json:"max_points"`
|
||||||
Mode string `json:"mode"`
|
Mode string `json:"mode"`
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ const (
|
|||||||
TIMESCALE = 1.0 // this tweaks the temporal duration of a TICK
|
TIMESCALE = 1.0 // this tweaks the temporal duration of a TICK
|
||||||
WIDTH = 800
|
WIDTH = 800
|
||||||
HEIGHT = 550
|
HEIGHT = 550
|
||||||
OBSTACLES = 10
|
OBSTACLE_COUNT = 5
|
||||||
MAX_POINTS = 500 // allowing for 50 pts in every category
|
MAX_POINTS = 500 // allowing for 50 pts in every category
|
||||||
DEFAULT_MODE = "deathmatch"
|
DEFAULT_MODE = "deathmatch"
|
||||||
)
|
)
|
||||||
@ -45,7 +45,7 @@ func LoadConfig(filename string) (Config, error) {
|
|||||||
Timescale: TIMESCALE,
|
Timescale: TIMESCALE,
|
||||||
Width: WIDTH,
|
Width: WIDTH,
|
||||||
Height: HEIGHT,
|
Height: HEIGHT,
|
||||||
Obstacles: OBSTACLES,
|
ObstacleCount: OBSTACLE_COUNT,
|
||||||
MaxPoints: MAX_POINTS,
|
MaxPoints: MAX_POINTS,
|
||||||
Mode: DEFAULT_MODE,
|
Mode: DEFAULT_MODE,
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ func (c *Controller) StartGame(w http.ResponseWriter, req *http.Request) {
|
|||||||
|
|
||||||
requested_game_name := c.Idg.Hash()
|
requested_game_name := c.Idg.Hash()
|
||||||
width, height := float32(c.Conf.Width), float32(c.Conf.Height)
|
width, height := float32(c.Conf.Width), float32(c.Conf.Height)
|
||||||
obstacles := 0
|
obstacleCount := 0
|
||||||
maxPoints := c.Conf.MaxPoints
|
maxPoints := c.Conf.MaxPoints
|
||||||
mode := "deathmatch"
|
mode := "deathmatch"
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ func (c *Controller) StartGame(w http.ResponseWriter, req *http.Request) {
|
|||||||
requested_game_name = cfg.Name
|
requested_game_name = cfg.Name
|
||||||
width = float32(cfg.Width)
|
width = float32(cfg.Width)
|
||||||
height = float32(cfg.Height)
|
height = float32(cfg.Height)
|
||||||
obstacles = cfg.Obstacles
|
obstacleCount = cfg.ObstacleCount
|
||||||
maxPoints = cfg.MaxPoints
|
maxPoints = cfg.MaxPoints
|
||||||
mode = cfg.Mode
|
mode = cfg.Mode
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ func (c *Controller) StartGame(w http.ResponseWriter, req *http.Request) {
|
|||||||
if g == nil {
|
if g == nil {
|
||||||
log.Printf("Game '%s' non-existant; making it now", requested_game_name)
|
log.Printf("Game '%s' non-existant; making it now", requested_game_name)
|
||||||
var err error
|
var err error
|
||||||
g, err = NewGame(requested_game_name, width, height, obstacles, c.Conf.Tick, maxPoints, mode)
|
g, err = NewGame(requested_game_name, width, height, obstacleCount, c.Conf.Tick, maxPoints, mode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("problem creating game: %s: %s", requested_game_name, err)
|
log.Printf("problem creating game: %s: %s", requested_game_name, err)
|
||||||
b, _ := json.Marshal(NewFailure("game creation failure"))
|
b, _ := json.Marshal(NewFailure("game creation failure"))
|
||||||
|
@ -177,7 +177,7 @@ func (c *Controller) AddPlayer(ws *websocket.Conn) {
|
|||||||
gid.Id,
|
gid.Id,
|
||||||
float32(c.Conf.Width),
|
float32(c.Conf.Width),
|
||||||
float32(c.Conf.Height),
|
float32(c.Conf.Height),
|
||||||
c.Conf.Obstacles,
|
c.Conf.ObstacleCount,
|
||||||
c.Conf.Tick,
|
c.Conf.Tick,
|
||||||
c.Conf.MaxPoints,
|
c.Conf.MaxPoints,
|
||||||
"",
|
"",
|
||||||
|
Loading…
Reference in New Issue
Block a user