I'm trying to decide how to detect collision, and overall object interaction. As of right now, I have the following format of classes:
Code:
CEngine ->CResourceManager---------------------------
->CTimer
->CIncludes
->CObject ------->CItem
------>CCharacter -------->CPlayer
-------->CEnemy
What this basically means is that CEngine handles the application, CResource manages the resources (images and things used for associating classes with their respectible bitmaps), and CObject has two branches:CItem (not yet used further, but will contain pick-up items (health, etc.) and static objects (maybe trees, and stuff) )
CCharacter which is the adult class for CPlayer and CEnemy.
Now my question is: if I have the input done in CEngine, I can easily pass it to the CObjects (by calling Update and passing in the input, or whatever) and update them.
HOwever, if something so deep, such as CEnemy, is updated with, say, a gunshot somewhere on screen, how can I come back and check the player to see if he has been hit?
The only real thing I can think of would be to store all information regarding objects on screen to the Resource Manager, and then updating everything again.
Or is there a better way?
Thanks,
Jason












