예제 #1
0
    def _on_left_down(self, event):
        #TODO: change event to fire with mouse key down, not only at the moment press
        dxy = event.GetPosition()
        dc = wx.ClientDC(self.canvas)
        dc.SetPen(wx.Pen('WHITE', 1))
        self.canvas.Draw(True)
        dc.DrawLine(self.canvas_size / 2, self.canvas_size / 2, dxy[0], dxy[1])
        dc.DrawCircle(dxy[0], dxy[1], 3)

        coordinates = event.GetCoords()
        self.runner(self.bot.shift_body_angle,
                    MathTools.coordinates2angle(*coordinates),
                    MathTools.vector_length(*coordinates))
        self.runner(self.bot.sleep, 0.5)
예제 #2
0
 def _on_left_down(self, event):
     self.runner(self.bot.make_step, MathTools.coordinates2angle(*event.GetCoords()))