First pass at documentations.

This commit is contained in:
sm
2014-04-14 00:26:41 -07:00
parent 0cf0957d73
commit faacfe7fd9
12 changed files with 172 additions and 49 deletions
+4
View File
@@ -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()