allow the control interface to specify game type
This commit is contained in:
@@ -18,15 +18,17 @@ type Config struct {
|
||||
Height int `json:"height"`
|
||||
Obstacles int `json:"obstacles"`
|
||||
MaxPoints int `json:"max_points"`
|
||||
Mode string `json:"mode"`
|
||||
}
|
||||
|
||||
const (
|
||||
TICK = 60
|
||||
TIMESCALE = 1.0
|
||||
WIDTH = 800
|
||||
HEIGHT = 550
|
||||
OBSTACLES = 5
|
||||
MAX_POINTS = 500 // allowing for 50 pts in every category
|
||||
TICK = 60
|
||||
TIMESCALE = 1.0
|
||||
WIDTH = 800
|
||||
HEIGHT = 550
|
||||
OBSTACLES = 5
|
||||
MAX_POINTS = 500 // allowing for 50 pts in every category
|
||||
DEFAULT_MODE = "deathmatch"
|
||||
)
|
||||
|
||||
func loadConfig(filename string) (Config, error) {
|
||||
@@ -37,6 +39,7 @@ func loadConfig(filename string) (Config, error) {
|
||||
Height: HEIGHT,
|
||||
Obstacles: OBSTACLES,
|
||||
MaxPoints: MAX_POINTS,
|
||||
Mode: DEFAULT_MODE,
|
||||
}
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user