stats stats stats stats
This commit is contained in:
@@ -281,6 +281,10 @@ func (r *Robot) Tick(g *game) {
|
||||
hit_robot.Health -= dmg
|
||||
hit_robot.Speed = (hit_robot.Speed * 0.5)
|
||||
// hit_robot.Heading = r.Heading
|
||||
if hit_robot.Health <= 0 {
|
||||
hit_robot.gameStats.Deaths++
|
||||
r.gameStats.Kills++
|
||||
}
|
||||
}
|
||||
|
||||
if r.Position != intersection_point {
|
||||
@@ -291,6 +295,11 @@ func (r *Robot) Tick(g *game) {
|
||||
r.MoveTo = &r.Position
|
||||
r.Speed = (r.Speed * -0.5)
|
||||
// r.Heading = r.Heading.Scale(-1.0)
|
||||
|
||||
if r.Health <= 0 {
|
||||
r.gameStats.Deaths++
|
||||
r.gameStats.Suicides++
|
||||
}
|
||||
} else {
|
||||
r.Position = r.Position.Add(move_vector)
|
||||
if new_heading.Mag() > 0 {
|
||||
|
||||
Reference in New Issue
Block a user