[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Float precision



Yes I see this.
I think most of the problem is here
                self.rect.centerx += dx
                self.rect.centery += dy
maybe centerx and centery need to be integers?
I had better luck when I changed it to like this
                self.xx += dx
                self.yy += dy
                self.rect.centerx = int(self.xx)
                self.rect.centery = int(self.yy)
where self.xx and self.yy are floats.
It was still not perfect but much better than before.
John




On Thu, 2008-07-03 at 19:36 +0200, OsKaR wrote:
> If you try to move forward and left or right it would made a perfect
> circle isn't?
> Well, if I do this the tank moves like a spring, it doesn't do a
> circle
> 
> 2008/7/3 PyMike <pymike93@xxxxxxxxx>:
>         You forgot to include the images, but I made some mockups
>         instead. I didn't see anything wrong with it though. Moved and
>         rotated nice and smoothly.
>         
>         
>         
>         On Thu, Jul 3, 2008 at 11:52 AM, OsKaR
>         <oscartorres10@xxxxxxxxx> wrote:
>                 Ok It's upload on mediafire
>                 Here is the link:
>                 http://www.mediafire.com/?222n1oyn1my
>                 
>                 Sorry for the poor or inexistent documentation :( I'm
>                 working on it too
>                 
>                 
>                 2008/7/3 PyMike <pymike93@xxxxxxxxx>:
>                 
>                 
>                         Hello,
>                         
>                         If the game's not too big, can you upload it
>                         on mediafire.com or stuffr.net? I can try to
>                         fix it up :-)
>                         
>                         
>                         
>                         On Thu, Jul 3, 2008 at 11:12 AM, OsKaR
>                         <oscartorres10@xxxxxxxxx> wrote:
>                                 I've tried both things and it still
>                                 working bad. I don't know what to do,
>                                 any more ideas? 
>                                 
>                                 2008/7/3 Ian Mallett
>                                 <geometrian@xxxxxxxxx>:
>                                 
>                                         P.S., you may want to convert
>                                         your angles to radians with
>                                         math's handy radians()
>                                         function.
>                                 
>                         
>                         
>                         
>                         
>                         -- 
>                         - pymike (http://pymike.pyedpypers.org/)
>                 
>         
>         
>         
>         -- 
>         - pymike (http://pymike.pyedpypers.org/)
>