You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
462 B
23 lines
462 B
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 |
|
}
|
|
|