ignore new binary
Create new bserv binary Herein lie the following ideas: - change package visibility of many things - try to stash the globals into structs - the code is far from correct; it merely compiles
This commit is contained in:
+6
-4
@@ -1,8 +1,9 @@
|
||||
package main
|
||||
package botserv
|
||||
|
||||
import (
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
"log"
|
||||
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
)
|
||||
|
||||
type Projectile struct {
|
||||
@@ -13,12 +14,13 @@ type Projectile struct {
|
||||
Speed float32 `json:"-"`
|
||||
Damage int `json:"-"`
|
||||
Owner *Robot `json:"-"`
|
||||
Delta float32
|
||||
}
|
||||
|
||||
func (p *Projectile) Tick(g *game) {
|
||||
func (p *Projectile) Tick(g *Game) {
|
||||
vec := p.MoveTo.Sub(p.Position)
|
||||
v_norm := vec.Normalize()
|
||||
v_scaled := v_norm.Scale(p.Speed * delta)
|
||||
v_scaled := v_norm.Scale(p.Speed * p.Delta)
|
||||
newPos := p.Position.Add(v_scaled)
|
||||
|
||||
hit_player := false
|
||||
|
||||
Reference in New Issue
Block a user