split splosions and projectiles into separate files
This commit is contained in:
@@ -103,31 +103,6 @@ func (s StatsRequest) Valid() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type Projectile struct {
|
||||
Id string `json:"id"`
|
||||
Position v.Point2d `json:"position"`
|
||||
MoveTo v.Point2d `json:"-"`
|
||||
Radius int `json:"radius"`
|
||||
Speed float32 `json:"-"`
|
||||
Damage int `json:"-"`
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type Instruction struct {
|
||||
MoveTo *v.Point2d `json:"move_to,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user