First pass at documentations.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
)
|
||||
|
||||
// Projectile are the things robots can shoot at eachother.
|
||||
type Projectile struct {
|
||||
Id string `json:"id"`
|
||||
Position v.Point2d `json:"position"`
|
||||
@@ -17,6 +18,9 @@ type Projectile struct {
|
||||
Delta float32
|
||||
}
|
||||
|
||||
// Projectile.Tick is called every game tick and moves projectiles along,
|
||||
// determines when they should blow up, and how damaage is propagated to
|
||||
// players.
|
||||
func (p *Projectile) Tick(g *Game) {
|
||||
vec := p.MoveTo.Sub(p.Position)
|
||||
v_norm := vec.Normalize()
|
||||
|
||||
Reference in New Issue
Block a user