No Description
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.

splosion.go 473B

1234567891011121314151617181920212223
  1. package server
  2. import (
  3. v "bitbucket.org/hackerbots/vector"
  4. )
  5. // Splosion embodies an explosion.
  6. type Splosion struct {
  7. Id string `json:"id"`
  8. Position v.Point2d `json:"position"`
  9. Radius int `json:"radius"`
  10. Lifespan int `json:"-"`
  11. }
  12. // Tick decrements the lifespan of said Splosion.
  13. func (s *Splosion) Tick() {
  14. s.Lifespan--
  15. }
  16. // Alive determines if this Splosion is still relevant.
  17. func (s *Splosion) Alive() bool {
  18. return s.Lifespan > 0
  19. }