Hi, I'm making a 2D game and I have a short question regarding where the logic of border collision should be placed.
For my 2D game, I made a small collision engine. In game design, should the collision engine have direct access to sprites? For example if the collision engine detects a collision between the sprite and the border of my game, should the collision engine then directly change the sprites position / velocity? If the collision engine detects collision between two sprites, should it be the one that directly access information such as sprite health bars etc?
My aim here is not to make a game engine, I am simply making a small collision engine for my game to abstract away collision logic, and have possible re-uses for the future. In order to accomplish my aim I would like to understand if it is good practice for the collision engine to access sprite data when a collision is detected. Or if there is a better / more standard design to do this.
Edit* Currently I am setting sprite coordinates from within the collision engine if a collision is detected.