[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Advice on turning sprite (newbie)
On Mon, Oct 26, 2009 at 04:03:20PM +0000, AdamC wrote:
> Currently, the tank moves around (although only once every time the
> key is pressed down - it doesn't move again if you hold the key down).
>
> Also, the tank doesn't turn. It would be nice to clear up these couple
> of problems.
>
> Here is the code as it stands:
>
> http://dpaste.com/112175/
>
> Thanks
> Adam
Your tank's .move_me() method should be called once in every single
cycle of the "while" loop. You should not be calling it at all inside
the event.key checks. I would put "tank.move_me(x_move, y_move)" right
before the "screen.blit(background, (0,0))"
---
James Paige