probe result
This commit is contained in:
parent
829ba83f41
commit
eabc1ebb41
@ -66,6 +66,7 @@ func (p *player) recv() {
|
||||
|
||||
if msg.Probe != nil {
|
||||
p.Robot.Probe = msg.Probe
|
||||
p.Robot.ProbeResult = nil
|
||||
} else {
|
||||
p.Robot.Probe = nil
|
||||
}
|
||||
@ -204,11 +205,11 @@ func (p *player) Tick(g *game) {
|
||||
}
|
||||
}
|
||||
|
||||
if p.Robot.Probe != nil {
|
||||
if p.Robot.Probe != nil && p.Robot.ProbeResult == nil {
|
||||
probe_vector := p.Robot.Probe.Sub(p.Robot.Position)
|
||||
coll, pos, _ := p.checkCollisions(g, probe_vector)
|
||||
if coll {
|
||||
p.Robot.Probe = &pos
|
||||
p.Robot.ProbeResult = &pos
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user