Original Post
Hi,
I am writing a 2d scrolling shooter game in c++/sdl, I have most of the basics already done, including collision detection, however I am wondering whether the way I am checking for collision is good for the long run, or I will have to rewrite the whole thing later.
What I am talking about is the way I currently have it is that during int (main) I call a global function that checks, loops through all the objects that needed to be checked for collision (player-enemy, enemy-enemy, player_bullet-enemy, enemy_bullet-player).
I am wondering if this centralized/separated way is the way to go, or I should do this more OO-y, that every object should have a collision check method for themselves.
Could someone with more experience with games involving collision detection give me some advice?
Thanks in advance!
I am writing a 2d scrolling shooter game in c++/sdl, I have most of the basics already done, including collision detection, however I am wondering whether the way I am checking for collision is good for the long run, or I will have to rewrite the whole thing later.
What I am talking about is the way I currently have it is that during int (main) I call a global function that checks, loops through all the objects that needed to be checked for collision (player-enemy, enemy-enemy, player_bullet-enemy, enemy_bullet-player).
I am wondering if this centralized/separated way is the way to go, or I should do this more OO-y, that every object should have a collision check method for themselves.
Could someone with more experience with games involving collision detection give me some advice?
Thanks in advance!