I'm currently reading "Game Programming Patterns by Robert Nystrom". The book explains why you should "un-couple" the different components of a piece of software, in my case a game.
Unfortunately, I already started hacking together a little game, and in there I have a Physics-Class which holds all the game-objects (Ranging from static things like... rocks, to other things like the player and the enemies) and applies physics to them on each update-tick. I then have a render-loop in my Main-Class, which loops through the objects present in the physics-world and renders them on the screen.
So here comes my question: How can I change my code in order to "de-couple" my Physics-Class from the Rendering-Part of my Main-Class? Should I maybe create two different objects for each game-object (I mean, that would complicate everything, so I don't think this is the right thing to do)?
Kind regards