2013-10-20 20:54:19 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
v "bitbucket.org/hackerbots/vector"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Splosion struct {
|
2013-11-09 21:46:49 -08:00
|
|
|
Id string `json:"id"`
|
|
|
|
Position v.Point2d `json:"position"`
|
|
|
|
Radius int `json:"radius"`
|
|
|
|
Lifespan int `json:"-"`
|
2013-10-20 20:54:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Splosion) Tick() {
|
|
|
|
s.Lifespan--
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Splosion) Alive() bool {
|
|
|
|
return s.Lifespan > 0
|
|
|
|
}
|