A few thoughts:
Your game logic needs to be
somewhere. So, there is definitely a place that does have a lot of code.
I would definitely be interested in your wisdom and experience, since like I said, after a while I end up coding myself into a corner, and adding a new change feels like a game of Jenga.
See, this is the basic idea of OOP or software architecture. Writing structured code is
pointless if you write software that's done in one shot. A good software architecture deals with
change to the project. If your software never changes, just dump everything in the update method. That's fine.
So, as you've said already: There's no right or wrong. There are only principles that allow a bit more flexibility later and some that allow less. You could for sure write a Tetris game that can be turned into Street Fighter. However, this is probably quite a bit over-engineered and doesn't serve the purpose to get that game out there.
The key is now to identify
core functionalities that apply to many different games. Just have a look at the many different plugins for Impact. All of them solve problems that are similar in many games. For example,
this is a nice path finding plugin that does a lot of work under the hood and you have to call only one function.
Your update method calls
followPath
and the rest is done by the plugin. It can be used in a Command and Conquer style game or in a Pacman clone. Doesn't matter.
So, if you find core functionalities, you want to try to make them as widely usable as possible. As a consequence, the core functionality itself is hidden in another object or class (OOP principle
encapsulation) and your player entity doesn't know anything about pathfinding anymore. It delegates the pathfinding to this other class. It's not really an entity, because it's not present in the game world. It's more like a
manager or something like that.
It's even possible to give an entity functionality that it doesn't even know that it has. Compare this to a board game, say, Chess: You have different pieces. Do the pieces know by themselves how they move? Or is there an instance that knows the movement of all pieces? In the latter case, every piece (entity) doesn't even know that it can move, but there's something like a puppet master that moves pieces. Then, you have two players. Do they move pieces? Or is there an invisible third instance that knows the rules how to move pieces and players tell this instance which piece they want to move? This would allow more than two players and it would also allow different piece movement. You could have a "classic chess piece mover" and a "fancy chess piece mover" that has different rules.
Again, no right or wrong here, just different approaches with different goals and different sophistication to deal with
changes to the software.
And to make this post a bit more practical and not only some abstract braindump:
I do similar stuff like Joncom.
The minimum I do for readability is to break up stuff in different methods.
The next step is to use other classes that handle stuff for the entity.
Even more advanced would be to use general plugins that are not necessarily custom to my game that entites can use or that inject functionality into entities.
Again, depends on the size of the project, my idea of the game, how fast I want to finish it and whether I expect changes or not.