Skip to content

I've implemented the two apples dynamic#62

Open
LucasPiovanii wants to merge 1 commit intomainfrom
feature/60/two-apples-dynamic
Open

I've implemented the two apples dynamic#62
LucasPiovanii wants to merge 1 commit intomainfrom
feature/60/two-apples-dynamic

Conversation

@LucasPiovanii
Copy link

Enhancement #60

[feature]: Added two apples at the same time in the game

Added variables:

  • Apple1
  • Apple2

I have also created two methods in the apple class. The first one is called "is_eaten(self, snake)" and it verifies if the apple and the snake head are in the same position. The second one is called "spawn(self)" and it generates the apples in a way that they don't appear in the same space. In the main loop, I've added two statements in the game_on condition: if apple 1 is eaten, then the snake grows and apple 1 spawns; if apple 2 is eaten, then the snake grows and apple 2 spawns.

@LucasPiovanii LucasPiovanii linked an issue Oct 16, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add two apples dynamic

1 participant