horstjens/ThePythonGameBook — pull request #18 by kocourOggy (2013-09-13 20:33:13+00:00)
Title: Update 011_rotozoom.py

I've noticed a bit strange behavior in the program (running in Python 3). If you're zooming the snake, the snake starts moving to an upper-left corner of the screen. After a rotation of the snake the program works properly.
You count center with two different ways that have two slight different results.
For example:
pygame.Rect.width = 201
pygame.Rect.width / 2 = 100.5 (It counts with decimal point in Python 3. Of course it works properly in Python 2.)
pygame.Rect.centerx = 100
Width and height is always even number after rotating the snake. So once you used rotating it works correctly in Python 3 as well.
I would prefer a form: snakex += (oldrect.centerx - newrect.centerx) or (oldrect.width /2 - newrect.width / 2), because this form works without problems in Python 3 and Python 2.