[Pogamut-list] Turning and moving at the same time?

jakub.gemrot pogamut-forum at artemis.ms.mff.cuni.cz
Wed Jan 21 18:42:19 CET 2009


Re: Turning and moving at the same time?

Author: jakub.gemrot

Hi Niels, welcome to the forum!

The turning/moving question is the most tricky thing.
Basicly the turnXYZ command overrides contMove / runTo command.
So if you do 
body.turnHorizontal()
body.contMove()
the bot won't turn a bit but instead of that it will run forward.

The option would be to simulate it with body.strafeTo() where you may set
the location where the bot should be running to and set the location where the bot
should be facing to (during the run).

So you may every doLogic() recount how much the bot should have turned and change the
target, where the bot is running. It won't look smooth (the running) as if it was a car
but it should suffice.

Good luck!

Jakub





More information about the Pogamut-list mailing list