By the way you can modify the game's configuration so that red tanks become blue and green tank becomes red (if you're a communist you'd prefer playing a red tank yeah i get that) or run faster.
Make sure you keep aside a backup config before making the game unplayable.
Here's the animation.xml for red vs blue like the old days c&c red alert.
<animations>
<animation name="joueur_stop" duration="1">
<frame left="0" top="32" width="32" height="32"/>
</animation>
<animation name="joueur_run" duration="1000000">
<frame left="0" top="32" width="32" height="32"/>
<frame left="32" top="32" width="32" height="32"/>
<frame left="64" top="32" width="32" height="32"/>
<frame left="96" top="32" width="32" height="32"/>
<frame left="128" top="32" width="32" height="32"/>
<frame left="160" top="32" width="32" height="32"/>
<frame left="192" top="32" width="32" height="32"/>
<frame left="224" top="32" width="32" height="32"/>
</animation>
<animation name="ennemi_stop" duration="1">
<frame left="0" top="96" width="32" height="32"/>
</animation>
<animation name="ennemi_run" duration="1000000">
<frame left="0" top="96" width="32" height="32"/>
<frame left="32" top="96" width="32" height="32"/>
<frame left="64" top="96" width="32" height="32"/>
<frame left="96" top="96" width="32" height="32"/>
<frame left="128" top="96" width="32" height="32"/>
<frame left="160" top="96" width="32" height="32"/>
<frame left="192" top="96" width="32" height="32"/>
<frame left="224" top="96" width="32" height="32"/>
</animation>
<animation name="bullet_fire" duration="1">
<frame left="180" top="117" width="16" height="17"/>
</animation>
<animation name="fire_smoke" duration="1000000">
<frame left="0" top="560" width="130" height="90"/>
<frame left="130" top="560" width="130" height="90"/>
<frame left="260" top="560" width="130" height="90"/>
<frame left="390" top="560" width="130" height="90"/>
<frame left="520" top="560" width="130" height="90"/>
<frame left="650" top="560" width="130" height="90"/>
</animation>
<animation name="explosion" duration="750000">
<frame left="0" top="0" width="64" height="64"/>
<frame left="64" top="0" width="64" height="64"/>
<frame left="128" top="0" width="64" height="64"/>
<frame left="192" top="0" width="64" height="64"/>
<frame left="0" top="64" width="64" height="64"/>
<frame left="64" top="64" width="64" height="64"/>
<frame left="128" top="64" width="64" height="64"/>
<frame left="192" top="64" width="64" height="64"/>
<frame left="0" top="128" width="64" height="64"/>
<frame left="64" top="128" width="64" height="64"/>
<frame left="128" top="128" width="64" height="64"/>
<frame left="192" top="128" width="64" height="64"/>
<frame left="0" top="192" width="64" height="64"/>
<frame left="64" top="192" width="64" height="64"/>
<frame left="128" top="192" width="64" height="64"/>
<frame left="192" top="192" width="64" height="64"/>
</animation>
</animations>
there's a bug with health points z-index.
bodies are described as follow (from physics.xml) :
<physics>
<world gravity="0.0"/>
<body name="shell" type="dynamic">
<fixture density="0.5" friction="0.3" restitution="0.5">
<shape type="box">
<point x="7.0" y="2.0"/>
</shape>
</fixture>
</body>
</physics>
for the moment only "boxes" shapes are supported, but i will probably add polygon and circle shaped bodies.
body defs are loaded in memory and reused when needed by their name.
I'm currently doing some tests in order to add scripting capabilities to the game (or even maybe the engine) throught chaiscript (http://chaiscript.com/).
for the moment bullet behavior is defined at compile time :
void Bullet::renderLogic()
{
if(!collision())
{
sf::Vector3f pos = myEntity->getPosition();
myEntity->setPosition(pos.x+(speed.x*(myInterpolation)),
pos.y+(speed.y*(myInterpolation)));
}
else
{
unregister();
}
}
But now i'm able to write :
void Bullet::renderLogic()
{
chai.eval_file("bullet.chai");
}
And edit the bullet.chai as follow :
if(!this.collision())
{
myEntity.setPosition(posX+(speedX*(myInterpolation)),
posY+(speedY*(myInterpolation)));
}
else
{
this.unregister();
}
Providing the binding information :
chai.add(chaiscript::var(this),"this");
chai.add(chaiscript::fun(&Bullet::collision),"collision");
chai.add(chaiscript::var(myEntity),"myEntity");
chai.add(chaiscript::var(&myInterpolation),"myInterpolation");
chai.add(chaiscript::fun(&se::Entity::setPosition),"setPosition");
chai.add(chaiscript::var(&speed.x),"speedX");
chai.add(chaiscript::var(&speed.y),"speedY");
chai.add(chaiscript::fun(&se::Entity::getPosition),"getPosition");
chai.add(chaiscript::var(&myEntity->getPosition().x),"posX");
chai.add(chaiscript::var(&myEntity->getPosition().y),"posY");
chai.add(chaiscript::fun<void (Bullet::*) ()>(&Bullet::unregister),"unregister");