float32 -> float64
This commit is contained in:
+3
-3
@@ -12,10 +12,10 @@ type Projectile struct {
|
||||
Position v.Point2d `json:"position"`
|
||||
MoveTo v.Point2d `json:"-"`
|
||||
Radius int `json:"-"`
|
||||
Speed float32 `json:"-"`
|
||||
Speed float64 `json:"-"`
|
||||
Damage int `json:"-"`
|
||||
Owner *Robot `json:"-"`
|
||||
Delta float32
|
||||
Delta float64
|
||||
}
|
||||
|
||||
// Projectile.Tick is called every game tick and moves projectiles along,
|
||||
@@ -98,7 +98,7 @@ func (p *Projectile) Tick(g *Game) {
|
||||
for player := range g.players {
|
||||
for _, r := range player.Robots {
|
||||
dist := v.Distance(r.Position, p.Position)
|
||||
if dist < float32(p.Radius) {
|
||||
if dist < float64(p.Radius) {
|
||||
if r.Health > 0 {
|
||||
r.Health -= p.Damage
|
||||
r.Hit = true
|
||||
|
||||
Reference in New Issue
Block a user