A battle arena built in go for hack meetups.
- To run the webserver/game arena run
go run app.go
- open your web browser to
localhost:3000
package main
import (
"github.com/tanema/botbattle/client"
)
func main() {
botclient, err := client.NewBotClient("localhost:3333", "sir killalot")
... //check out example/bot.go for an example on how to use it
}
func NewBotClient(host, botname string) (*BotClient, error)
type Status
Id int
Name string
X int
Y int
Rotation int
Health int
KillCount int
type BotClient
ArenaHeight int
ArenaWidth int
func Reconnect() (*BotClient, error)
func MoveForward() (*Status, error)
func MoveBackward() (*Status, error)
func FireGun() (bool, error)
func FireCannon() (bool, error)
func RotLeft() (*Status, error)
func RotRight() (*Status, error)
func Scan() ([]*Status, error)
func Status() (*Status, error)
func Shield() (bool, error)
- Moves forward in the direction that you are facing
- has a delay of 500 milleseconds
- returns
- current status of bot
- error if you have been killed or disconnected
- Moves backward in the direction that you are facing
- has a delay of 500 milleseconds
- returns
- current status of bot
- error if you have been killed or disconnected
- Will return true if the bullet hit somethin
- has a damage of 25
- has a delay of 1000 milleseconds
- returns
- bool of the success of the shot
- error if you have been killed or disconnected
- Will return true if the bullet hit somethin
- has a damage of 50
- has a delay of 3000 milleseconds
- returns
- bool of the success of the shot
- error if you have been killed or disconnected
- Rotates -90 degrees
- has a delay of 500 milleseconds
- returns
- current status of bot
- error if you have been killed or disconnected
- Rotates 90 degrees
- has a delay of 500 milleseconds
- returns
- current status of bot
- error if you have been killed or disconnected
- Will return array of status's of the bots you can see
- returns empty array if you see nothing
- has a delay of 500 milleseconds
- returns
- current status of bots that you can see
- error if you have been killed or disconnected
- Will return the status of your own bot please to refer to the status object for what info is included
- returns
- current status of bot
- error if you have been killed or disconnected
- Will return true if the shield was enabled
- has a warmup time of 5000 millesecond
- will remain on for 3000 milleseconds
- returns
- bool of the success in enabling the shield
- error if you have been killed or disconnected