1class Button(object):
2 def __init__(self,x,y,width,height,color):
3 self.rect = pygame.Rect(x,y,width,height)
4 self.image=pygame.draw.rect(screen, color,(self.rect),)
5 self.x=x
6 self.y=y
7 self.width=width
8 self.height=height
9
10 def check(self):
11 return self.rect.collidepoint(pygame.mouse.get_pos())