[pygame] On walking animations...
I was wondering how one could do walking animations with sprites in pygame. I know that it has been done before, and it probably involves utilizing the key.pressed function in the Vector2 module, where when you press a key the command retrieves a series of images for the sprite based on certain values given. I have no idea how to implement this, though, and my theory could be very wrong. All I know is that it has been done before, so I have hope. Yeah.
Re: [pygame] Seeing if this works...
Yeah I included a big enough background, and it works now. Thanks. On 10/5/09, Henrique Nakashima wrote: > When you blit a sprite to the screen, it is not erased from where it > was previously blitted. You gotta do it manually, blitting the > background over everything then the sprite in its new position. > > Alternatively, to avoid blitting the whole screen every loop, you can > only blit the part of the background which was covered by the sprite > in the previous frame, "patching" it. This technique is called dirty > rectangles. Actually, there is a module in pygame - which I never used > myself - for doing that: > http://www.pygame.org/docs/ref/sprite.html#pygame.sprite.DirtySprite > > On Tue, Oct 6, 2009 at 00:33, Guy Anderson wrote: >> Well okay :) >> >> I'm currently working on a game that will utilize linear movement. I >> have successfully made it so that the sprite moves around with the >> arrow keys, but for some reason it leaves sort of a "sprite-trail" >> when moving; that is, the sprites from the previous positions don't >> clear. I've tried utilizing the clear and dirty commands from the >> pygame module, but I've been unsuccessful. If anyone could help me >> with this, it would be great. >> >> I am attaching the code with the sprite used. >> >> On 10/5/09, Luke Paireepinart wrote: >>> Works fine, Guy.Now on with the questions! :) >>> Also, if your questions are not pygame-specific, please consider >>> subscribing >>> to the Python Tutor mailing list, there's a lot of cool guys over on that >>> list who are happy to help with basic Python questions. >>> >>> On Tue, Oct 6, 2009 at 5:05 AM, Guy Anderson >>> wrote: >>> >>>> If this is annoying, I don't blame you. It's been years since I've >>>> been on a mailing list, though, so I'm trying to see how it all works >>>> out. >>>> >>>> I will have a basic programming question soon, though. >>>> >>> >> >
Re: [pygame] Seeing if this works...
Well okay :) I'm currently working on a game that will utilize linear movement. I have successfully made it so that the sprite moves around with the arrow keys, but for some reason it leaves sort of a "sprite-trail" when moving; that is, the sprites from the previous positions don't clear. I've tried utilizing the clear and dirty commands from the pygame module, but I've been unsuccessful. If anyone could help me with this, it would be great. I am attaching the code with the sprite used. On 10/5/09, Luke Paireepinart wrote: > Works fine, Guy.Now on with the questions! :) > Also, if your questions are not pygame-specific, please consider subscribing > to the Python Tutor mailing list, there's a lot of cool guys over on that > list who are happy to help with basic Python questions. > > On Tue, Oct 6, 2009 at 5:05 AM, Guy Anderson > wrote: > >> If this is annoying, I don't blame you. It's been years since I've >> been on a mailing list, though, so I'm trying to see how it all works >> out. >> >> I will have a basic programming question soon, though. >> > Example.rar Description: application/rar-compressed
[pygame] Seeing if this works...
If this is annoying, I don't blame you. It's been years since I've been on a mailing list, though, so I'm trying to see how it all works out. I will have a basic programming question soon, though.