Thursday, 24 October 2013

Better architecture!

So the system looks better! MUCH BETTER!

A better way of implementing the Entity Component system

Added 2 new scripts

1. CollisionDetector - This will be attached to the hands, legs and any body part of the player which needs collision.

this has 2 variables -
      *. delegateGameObject - this will be the game object to which it should report saying that something has hit. So example, If the script is running on the left hand, and if the left hand hits an enemy's head, it will tell the delegateGameObject(we are intending to make this "Player") that left hand has hit enemy's head
     *. bodyPart - An enum that holds the type of body part it is attached to


2. CollisionHandler - This will be attached to the player and will take all the calls from collisionDetector and will be responsible for the decisions that is to be taken once the collision has happened.

Now this is really generic!!! Whew!!!!

No comments:

Post a Comment