This time, the tankdemo is slightly altered to demonstrate how to rotate toward a target. Please notice that the video as well as the graphic display a older version of the sourcecode (in the video, the display for turret angle and tank angle is swapped). To get the latest, most bug-free version you need python and pygame installed on your computer, download the code from ThePythonGameBook and run it yourself.
<iframe width=“480” height=“360” src=“https://www.youtube.com/embed/nfaOmkhK-V0” frameborder=“0” allowfullscreen></iframe>
[caption id=“attachment_330” align=“aligncenter” width=“636” caption=“Target demo. See the full article on http://ThePythonGameBook.com”][/caption]