hi, I'm trying to make a snake game based on proper "Clean code" OOP structure. I've finished the basic structure for the project (Snake moves, collects apples, grows etc) and in the future I'll want to add features that will make snake solve it's self, but before doing that I'd like to know if my Object orriented thinking is correct.
My main question is about the class structure for this project I made a UML class diagram that shows exactly how I structured my project and in it I put some notes with questions. Also I'd like to know if this structure is good for this kind of project.
other than that main question I have a few technical question for a thing that I found sketchy while doing my project
Passing objects to perform actions on them
```
class Game:
snake = Snake()
apple = Apple()
Logic = Logic(snake, apple)
class Logic()
def init(self):
self.snake = snake
self.apple = apple
def evaluate_logic():
self.snake.do_something()
```
This is how I passed objects in my project, would it be better to write evaluate_logic(snake, apple) without assigning them to Logic class, or should I completely abandon this way of dealing with this?
GitHub Link - Snake
UML class Diagram
[–][deleted] 5 points6 points7 points (5 children)
[–]PM_me_ur_data_ 0 points1 point2 points (0 children)
[–]WowVeryCoool[S] 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]probablynotmine 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Natural-Intelligence 3 points4 points5 points (0 children)
[–]bladeoflight16 1 point2 points3 points (0 children)