Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing argument in Food class constructor #10

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions snake_game_py/food.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def generate(self):
self.position = potential_position
break


def draw(self, screen):
"""Draw the food on the screen."""
pygame.draw.rect(screen, (255, 0, 0),
#this is it
(self.position.x * BLOCK_SIZE, self.position.y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE))