Difference between revisions of "Talk:CalculatingScore"
Jump to navigation
Jump to search
(Is it possible to calculate the score for an AdvancedRobot?) |
RednaxelaBot (talk | contribs) m (Using <syntaxhighlight>.) |
||
Line 1: | Line 1: | ||
Is it possible to calculate the score for an AdvancedRobot? I'm having problems with the HitRobotEvent | Is it possible to calculate the score for an AdvancedRobot? I'm having problems with the HitRobotEvent | ||
− | < | + | <syntaxhighlight> |
public void onHitRobot(HitRobotEvent e) { | public void onHitRobot(HitRobotEvent e) { | ||
ramDamage[e.isMyFault() ? 0 : 1] += robocode.Rules.ROBOT_HIT_DAMAGE; | ramDamage[e.isMyFault() ? 0 : 1] += robocode.Rules.ROBOT_HIT_DAMAGE; | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
When isMyFault=false the enemy doesn't always get points for it. For instance a RamBot against SittingDuck. | When isMyFault=false the enemy doesn't always get points for it. For instance a RamBot against SittingDuck. | ||
The underDevelopment class is here [[Talk:CalculatingScore/ScoreWithRamming]] | The underDevelopment class is here [[Talk:CalculatingScore/ScoreWithRamming]] |
Latest revision as of 09:33, 1 July 2010
Is it possible to calculate the score for an AdvancedRobot? I'm having problems with the HitRobotEvent
public void onHitRobot(HitRobotEvent e) {
ramDamage[e.isMyFault() ? 0 : 1] += robocode.Rules.ROBOT_HIT_DAMAGE;
}
When isMyFault=false the enemy doesn't always get points for it. For instance a RamBot against SittingDuck. The underDevelopment class is here Talk:CalculatingScore/ScoreWithRamming