diliup gabadamudalige
2015-04-28 15:38:46 UTC
---------- Forwarded message ----------
From: diliup gabadamudalige <***@gmail.com>
Date: Tue, Apr 28, 2015 at 6:22 PM
Subject: circular movement in pygame
To: pygame-***@seul.org
Looking at the code on this page lines 47 & 48
http://programarcadegames.com/python_examples/show_file.php?file=sprite_circle_movement.py
is there a way to do
self.rect.x +*= some value*
self.rect.y += some value
rather than
self.rect.x = self.radius * math.sin(self.angle) + self.center_x
self.rect.y = self.radius * math.cos(self.angle) + self.center_y
?
I tired it in the code attached and strangely it works ok but only OUTSIDE
THE class. When I implement the exact code in a class it does something
weird. I can't find where I have gone wrong.
Please help.
Many thanks in advance.
Diliup Gabadamudalige
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
From: diliup gabadamudalige <***@gmail.com>
Date: Tue, Apr 28, 2015 at 6:22 PM
Subject: circular movement in pygame
To: pygame-***@seul.org
Looking at the code on this page lines 47 & 48
http://programarcadegames.com/python_examples/show_file.php?file=sprite_circle_movement.py
is there a way to do
self.rect.x +*= some value*
self.rect.y += some value
rather than
self.rect.x = self.radius * math.sin(self.angle) + self.center_x
self.rect.y = self.radius * math.cos(self.angle) + self.center_y
?
I tired it in the code attached and strangely it works ok but only OUTSIDE
THE class. When I implement the exact code in a class it does something
weird. I can't find where I have gone wrong.
Please help.
Many thanks in advance.
Diliup Gabadamudalige
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************