A youtube version of this video can be found here.
As you can see there is now an animation system to allow for simple animation of blocks on the playing field. The example here is the simple junction box, which can be used to change the direction of travel for each of the firework crates.
As far as graphics goes, i just have to implement machines, crates, and the particle system and all basics will then be implemented.
The Animation system works by attaching an 'animation' derived class to the Box object, and then calling the DoUpdate() method of each animation object once per frame. Constructors of the Animation derived classes contain the basic instructions required to perform the animation, as shown below:[code=nocode:0]JunctionAnimation::JunctionAnimation(Box* b) : Animation(b){ instructions += AniInstruction(0.0f, 0.01f, 0.0f, 0.f, 0.0f, 0.0f, 10), // Raise up AniInstruction(0.0f, 0.0f, 0.0f, 0.f, 2.0f, 0.0f, 45), // Rotate 90 degrees AniInstruction(0.0f, -0.01f, 0.0f, 0.f, 0.0f, 0.0f, 10); // Sink down}JunctionBox::JunctionBox(float _x, float _y, float _z, float _rotation, DX11* dx11) : Box(_x, _y, _z, _rotation, dx11->textures[L"step1.png"], dx11), anim(NULL){}void JunctionBox::OnUpdate(){ if (anim) { anim->Update(); if (anim->IsFinished()) { delete anim; anim = NULL; } }}void JunctionBox::OnClick(const POINT &p, float pickedDist, const XMVECTOR &prwsPos, const XMVECTOR &prwsDir){ if (anim == NULL) { anim = new JunctionAnimation(this); }}JunctionBox::~JunctionBox(){ if (anim) { delete anim; anim = NULL; }}This uses boost::assign to make things nice and simple and easy to read
![smile.png](http://public.gamedev5.net//public/style_emoticons/default/smile.png)
Next on the todo list: Particle effects for the crate explosions! I probably can't re-use much of the 2D particle system i created before, so wish me luck!