split splosions and projectiles into separate files

This commit is contained in:
Fraser Graham
2013-10-20 20:54:19 -07:00
parent 541e213c66
commit 776a7eee98
5 changed files with 100 additions and 79 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
v "bitbucket.org/hackerbots/vector"
)
type Splosion struct {
Id string `json:"id"`
Position v.Point2d `json:"position"`
Radius int `json:"radius"`
MaxDamage int `json:"-"`
MinDamage int `json:"-"`
Lifespan int `json:"-"`
}
func (s *Splosion) Tick() {
s.Lifespan--
}
func (s *Splosion) Alive() bool {
return s.Lifespan > 0
}