Separating game code and engine code

Separating game code and engine code

mast3rpyr0's picture

I am fairly new to game development so I want to ask what some of you more veteran developers do when it comes to making a game.

When I am coding, I tend to think of only the current project and I develop all the code in such a way that it makes that project work.

What I am wondering is how you separate what is to be engine code, stuff like physics, collision detection, etc that I can copy and paste into a new project, and never modify that part of it(except when improving it) and still create a whole new game around it that is code that will specifically load this game's assets and rules.

I think that makes sense.. let me know if you need any more clarification.

Thanks