[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] moving the ship



you can try to keep floats of the "real" position and then round them when 
drawing but do all movement and stuff on the "real" ones

Op dinsdag 8 oktober 2002 10:38, schreef azazel:
> hi pygame users, I've a semi-OT question that isn't very inherent in
> pygame. I've written a simple game, and I need a way to move my ship. When
> the ship fly vertically or horizontally I add or remove 1 to the x or y
> axis, making the ship moving 1 pixel per frame. If I try to change the
> step(a number different that 1) I lose the fluid movement, because the ship
> seems to "jump" every frame.
>
> But when I try to move my ship diagonally I have a problem. The x and y
> increments are calculated by the sine and cosine of the step, but if this
> is 1 or another low number(for fluid movement) there is a very bad
> precision in the movement...What can I do?
>
> thank you
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org