Code Monkey home page Code Monkey logo

botbattle's Introduction

botbattle

A battle arena built in go for a upcoming go hack meetup.

##Server

  • To run the webserver/game arena run go run app.go
  • open your web browser to localhost:3000

##Client/Bot

package main

import (
	"botbattle/client"
)

func main() {
	botclient := client.NewBotClient("localhost:3333", "sir killalot")
  ... //check out example/bot.go for an example on how to use it
}

###Client API

func NewBotClient(host, botname string) (*BotClient)
type Status
  Id           int
	X            int
	Y            int
	Rotation     int
	Health       int
type BotClient
  ArenaHeight int
  ArenaWidth  int
  func MoveForward() (x, y int)
  func MoveBackward() (x, y int)
  func FireGun() bool
  func FireCannon() bool
  func RotLeft() (rotation int)
  func RotRight() (rotation int)
  func Scan() ([]*Status)
  func Status() (*Status)
  func Shield() bool

####func MoveForward() (x, y int)

  • Moves forward in the direction that you are facing
  • has a delay of 500 milleseconds

####func MoveBackward() (x, y int)

  • Moves backward in the direction that you are facing
  • has a delay of 500 milleseconds

####func FireGun() bool

  • Will return true if the bullet hit somethin
  • has a damage of 25
  • has a delay of 1000 milleseconds

####func FireCannon() bool

  • Will return true if the bullet hit somethin
  • has a damage of 50
  • has a delay of 3000 milleseconds

####func RotateLeft() (rotation int)

  • Rotates -90 degrees
  • has a delay of 500 milleseconds

####func RotateRight() (rotation int)

  • Rotates 90 degrees
  • has a delay of 500 milleseconds

####func Scan() ([]*Status)

  • 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

####func Status() (*Status)

  • Will return the status of your own bot please to refer to the status object for what info is included

####func Shield() bool

  • Will return true if the shield was enabled
  • has a warmup time of 5000 millesecond
  • will remain on for 3000 milleseconds

botbattle's People

Contributors

grovespaz avatar ssoroka avatar tanema avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.