added fireRate flag

This commit is contained in:
Stephen McQuay 2013-10-19 00:30:20 -07:00
parent e07b24afdc
commit 9fad1a7ad3
1 changed files with 9 additions and 5 deletions

14
main.go
View File

@ -13,11 +13,13 @@ import (
"time"
)
var hp = flag.Int("hp", 150, "")
var speed = flag.Float64("speed", 150, "")
var acceleration = flag.Float64("acceleration", 10, "")
var weaponRadius = flag.Int("wrad", 100, "weapon radius")
var scannerRadius = flag.Int("srad", 100, "scanner radius")
var hp = flag.Int("hp", 50, "")
var speed = flag.Float64("speed", 50, "")
var acceleration = flag.Float64("acceleration", 50, "")
var weaponRadius = flag.Int("wrad", 50, "weapon radius")
var scannerRadius = flag.Int("srad", 50, "scanner radius")
var fireRate = flag.Int("fire-rate", 50, "scanner radius")
var server = flag.String("server", "hackerbots.us", "server hostname")
var port = flag.Int("port", 8666, "server port")
var botname = flag.String("name", "gobot", "the name that other players will see")
@ -34,6 +36,7 @@ type Stats struct {
Acceleration float64 `json:"acceleration"`
WeaponRadius int `json:"weapon_radius"`
ScannerRadius int `json:"scanner_radius"`
FireRate int `json:"fire_rate"`
}
type Scanner struct {
@ -166,6 +169,7 @@ func negociate(ws *websocket.Conn, gameid string) (i *infos, err error) {
Acceleration: *acceleration,
WeaponRadius: *weaponRadius,
ScannerRadius: *scannerRadius,
FireRate: *fireRate,
},
})