21 lines
334 B
Go
21 lines
334 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
v "bitbucket.org/hackerbots/vector"
|
||
|
)
|
||
|
|
||
|
type Splosion struct {
|
||
|
Id string `json:"id"`
|
||
|
Position v.Point2d `json:"position"`
|
||
|
Radius int `json:"radius"`
|
||
|
Lifespan int `json:"-"`
|
||
|
}
|
||
|
|
||
|
func (s *Splosion) Tick() {
|
||
|
s.Lifespan--
|
||
|
}
|
||
|
|
||
|
func (s *Splosion) Alive() bool {
|
||
|
return s.Lifespan > 0
|
||
|
}
|