Greetings. I have read all there is about logic and view separation in the book, but i dont get the whole picture, and i still didnt understand the concept even after reading source code. Can you explain it with example of some very simple game, please? Lets say, i have a multiplayer version of Pong:
[IMG:https://cdn.scratch.mit.edu/static/site/projects/thumbnails/301/3901.png]
What i dont understand is how it all fits together.
Obviously an Actor list should be in logic, but where do i store its visual representation, such as paddle image? Sounds like it should be in View, but how...
There is a place where i draw everything, what does it look like ? I can only think of View requesting list of all Actors from Logic and drawing them, but it kind of breaks the separation.
In this case of Pong, View is only sending UP/DOWN commands to Logic, but what kind of events Logic sends to view ?
Thanks in advance.
[IMG:https://cdn.scratch.mit.edu/static/site/projects/thumbnails/301/3901.png]
What i dont understand is how it all fits together.
Obviously an Actor list should be in logic, but where do i store its visual representation, such as paddle image? Sounds like it should be in View, but how...
There is a place where i draw everything, what does it look like ? I can only think of View requesting list of all Actors from Logic and drawing them, but it kind of breaks the separation.
In this case of Pong, View is only sending UP/DOWN commands to Logic, but what kind of events Logic sends to view ?
Thanks in advance.