diff --git a/snake/snake.py b/snake/snake.py index dd6c16b..d2398f4 100755 --- a/snake/snake.py +++ b/snake/snake.py @@ -25,7 +25,8 @@ class Snake: rect=pygame.Rect(0, self.margin-thickness, self.grid_width*self.grid_pts, thickness) pygame.draw.rect(self.screen,color,rect, 0) text = self.font.render('Score '+str(self.score)+" Length "+str(len(self.snake)), True, color) - self.screen.blit(text, dest=(self.grid_width*self.grid_pts/3.5,self.margin/3.5)) + text_center=text.get_rect(center = (self.grid_width*self.grid_pts // 2, self.margin // 2)) + self.screen.blit(text, text_center) def new_apple(self): self.apple=(random.randint(0,self.grid_width),random.randint(0,self.grid_height))