pygame.Rect around circle
        Posted  
        
            by 
                geekkid
            
        on Game Development
        
        See other posts from Game Development
        
            or by geekkid
        
        
        
        Published on 2012-06-02T21:37:37Z
        Indexed on 
            2012/06/02
            22:50 UTC
        
        
        Read the original article
        Hit count: 265
        
I'm trying to make a pong game in pygame , but i can't figure out how to but a ball circle , which i can create with pygame.draw.circle into a pygame.Rect object so i can use the colliderect function and manipulate the ball's position. For example, with rectangles, i can do something like this :
rect = pygame.Rect(255, 255, 100, 100) 
pygame.draw.rect(screen, yellow, rect) 
and then when i change the pygame.Rect object position , the drawing primitives position also changes. How can the same effect be achieved when i want to draw a circle, instead of a rectangle? Thank you.
© Game Development or respective owner