Shooting bullets from the end of a cannon barrel

Finally i found time and energy to write a new wiki page for ThePythonGameBook:
http://thepythongamebook.com/en:part2:pygame:step020 : “How to shooting bullets from the end of a cannon barrel”
Special thanks to Jonathan Persson for writing me an email about this problem. His email motivated me to wake up from winter sleep. Still a lot of existing wiki pages need improvement.

The code example is not a complete game but a working demo of a tank who can rotate, move, rotate it’s turrent and fire tracer rounds and bullets. The rounds are always created at the correct position (muzzle) , including the rotation of tank and turret.

Also i finally got The Ubuntu Video editor up and running, allowing me to show a video of how the tankdemo looks like:

Click on the images or follow the link above to read ThePythonGameBook / see and download the sourcecode.

tankdemo02


classchart20 of tankdemo02.py Sourcecode at http://thepythongamebook.com/en:part2:pygame:step020

Please motivate me using Flattr:
Flattr this

Advertisements

About Horst JENS

teaching open source game programming to kids
This entry was posted in pygame. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s