parent
713504a3d5
commit
3982e7ab40
2
main.py
2
main.py
|
@ -38,6 +38,8 @@ class Game:
|
|||
self.running = False
|
||||
print(e)
|
||||
|
||||
input("Press enter to leave from game")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
Game().play()
|
||||
|
|
|
@ -13,6 +13,8 @@ class Player:
|
|||
self.food = Food(0, 0, self)
|
||||
self.food.generate_new()
|
||||
|
||||
self.score = 0
|
||||
|
||||
def update(self) -> None:
|
||||
sleep(1 / FPS)
|
||||
|
||||
|
@ -31,6 +33,7 @@ class Player:
|
|||
|
||||
if self.body[-1] == self.food:
|
||||
self.food.generate_new()
|
||||
self.score += 1
|
||||
else:
|
||||
self.body.pop(0)
|
||||
|
||||
|
|
Loading…
Reference in New Issue