rotating polygon code for collision while walking with the mouse