made stats params flag-modifiable

This commit is contained in:
Stephen McQuay 2013-09-07 19:26:21 -07:00
parent db1afada10
commit eb9fa775b0

14
main.go
View File

@ -11,6 +11,11 @@ import (
"net/http"
)
var hp = flag.Int("hp", 100, "")
var speed = flag.Float64("speed", 100, "")
var weaponRadius = flag.Int("wrad", 100, "weapon radius")
var scannerRadius = flag.Int("srad", 100, "scanner radius")
func connect() (*websocket.Conn, error) {
origin := "http://localhost/"
url := "ws://localhost:8666/ws/"
@ -69,11 +74,10 @@ func negociate(ws *websocket.Conn, gameid string) (err error) {
err = websocket.JSON.Send(ws, &bot.Config{
gameid,
bot.Stats{
// TODO: make these flags
Hp: 200,
Speed: 100,
WeaponRadius: 50,
ScannerRadius: 50,
Hp: *hp,
Speed: *speed,
WeaponRadius: *weaponRadius,
ScannerRadius: *scannerRadius,
},
})