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

Re: [pygame] Some help, please...



Oh... I guess I didn't understand what was going on with the
rect.centre... Now I can see all my segments. Thanks a lot. :)

On 3/20/06, Ryan Charpentier <ryancharpen@xxxxxxxxx> wrote:
> When I ran your code all I got was a black screen. The reason you aren't
> seeing anything is the way you're using the draw.circle function. The
> position that you pass to it should be relative to the surface you're
> drawing on.
>
> Put these two lines in the __init__ for SnakeHead, SnakeBody, and SnakeTail:
>
> relativeCenter = self.rect.width / 2, self.rect.height / 2
> PG.draw.circle(self.image,(255,0,0),relativeCenter, 4)
>
>
> Also I noticed that you commented out the "import pygame" line in the test
> file. When you import something python will automatically check to see if
> the module has already been loaded, so there's no performance hit for
> importing it twice...
>