This is the part I currently need to work on for my own game..
What I've reasoned out so far is that I can have a
CollisionBox on the
GameObject which contains all the collision boundary information. Collisions are checked by
GameObject.isColliding(other) - where the two
CollisionBoxes compare whether they intersect.
GameObject has a
doCollision method which is overridden for various
public void doCollision(GameObject other)
case Inelastic: //etc
case Elastic: //etc
case Consumable: //(this one is for bullets, upgrades, pickups -
// things you collide with but the collision doesn't affect motion)
As you can maybe guess,
CollisionType is an enum which is assigned to
That was my initial plan anyway. Now I hope to take some inspiration from Collision detection and response in an Entity System - though I'll still probably end up with some type of "collisionType enum" to broadly group a type of collision.