[rspec-users] Game development: how to test interactions like an attack?
tribes.romain at gmail.com
Thu Feb 2 04:50:56 EST 2012
I'm writing webgames with Rails and I want to test my code (and even TDD) but I'm really stuck figuring what to test.
I read a lot of articles on the subject but I still don't know what to do in my case: how to start?
For instance, a simple interaction in most game: a character attacks another one. What should be tested?
With words, here is what I can say about an attack:
It's an action from an attacker to a target.
The attacker may have a weapon and the target may have an armor.
In order to be successful, the attacker must hit the target, according to the combat skill of each actor and the precision of the weapon.
When the target is hit, it receives damages according to the attacker power, the weapon damages and the resistance.
A part of these damages may be absorbed by it's armor.
So, what could my specs be with that? I really can't start… :(
Thanks for your help!
More information about the rspec-users