mercredi 18 mars 2015

MVC Pattern in Games: Animation?

Let's say my game has entities, and let's say all of those entities have a collision-hitbox consisting of multiple shapes. Let's also assume skeletal animation is used and each collision-shape corresponds to one bone. I implemented the basic MVC pattern by having one data-container, renderer and controller for each Entity type, fE:



class MyEntity:public Entity{
public: int x, y, state; vector<hitbox> hitboxArray;

class MyEntityRenderer:public Renderer{
void render(){
...
}
}
class MyEntityController:public Controller {
update(){}
inputstuff(){}
}


How can I now actually implement animations, if I want the hitboxes translations be modified depending on the animation and it's progress?


If I only had an animation I would clearly put the whole stuff in the Renderer, but what now? How can I apply MVC to this problem?


Aucun commentaire:

Enregistrer un commentaire