Minor changes
This commit is contained in:
parent
d2d29f4da3
commit
da1e1dd2c0
1 changed files with 2 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue