server/splosion.go
stephen mcquay 446eba5209 vantiy urls
I've moved remote to https://s.mcquay.me/hackerbots/ and stood up routes for go
get on the hackerbots repos. I had to update the imports for this to take
effect.
2015-04-30 23:07:21 -07:00

24 lines
462 B
Go

package server
import (
v "hackerbots.us/vector"
)
// Splosion embodies an explosion.
type Splosion struct {
Id string `json:"id"`
Position v.Point2d `json:"position"`
Radius int `json:"radius"`
Lifespan int `json:"-"`
}
// Tick decrements the lifespan of said Splosion.
func (s *Splosion) Tick() {
s.Lifespan--
}
// Alive determines if this Splosion is still relevant.
func (s *Splosion) Alive() bool {
return s.Lifespan > 0
}