I may have fixed some collision issues (badly)
This commit is contained in:
parent
1498414357
commit
c8913c563e
@ -145,9 +145,10 @@ func (p *player) Tick(g *game) {
|
||||
hit_player.Robot.Speed = (hit_player.Robot.Speed * 0.1)
|
||||
hit_player.Robot.Heading = p.Robot.Heading
|
||||
}
|
||||
move_by := intersection_point.Sub(p.Robot.Position).Scale(0.9)
|
||||
move_by := intersection_point.Sub(p.Robot.Position)
|
||||
move_dist := move_by.Scale(float32(math.Floor(float64(move_by.Mag()-3.0))) / move_by.Mag())
|
||||
|
||||
p.Robot.Position = p.Robot.Position.Add(move_by)
|
||||
p.Robot.Position = p.Robot.Position.Add(move_dist)
|
||||
p.Robot.Health -= int(p.Robot.Speed / 10.0)
|
||||
p.Robot.MoveTo = &p.Robot.Position
|
||||
p.Robot.Speed = (p.Robot.Speed * 0.1)
|
||||
|
Loading…
Reference in New Issue
Block a user