Difference between revisions of "Bullet"
Jump to navigation
Jump to search
(Might as well have this page now.) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
A bullet in Robocode is a line segment from the point where the bullet starts a tick, to the point where it finishes it. If that segment intercepts a robot the bullet is destroyed and the robot hit takes damage. The robot that fired the bullet gains three times the bullet's power in energy. | A bullet in Robocode is a line segment from the point where the bullet starts a tick, to the point where it finishes it. If that segment intercepts a robot the bullet is destroyed and the robot hit takes damage. The robot that fired the bullet gains three times the bullet's power in energy. | ||
− | A bullet can have a power between 0.1 and 3. When it is fired the firing robot's energy reduces by the power. | + | A bullet can have a power between 0.1 and 3. When it is fired the firing robot's energy reduces by the power. If a [[Bullet Shielding|bullet hits another bullet]], they are both destroyed. |
− | + | The damage done to the opponent uses the following formula. Unless the opponent has less energy then this, in which it destroys the enemy outright. | |
− | |||
− | The damage done to the opponent uses the following formula. | ||
<syntaxhighlight> | <syntaxhighlight> | ||
damage = power * 4; | damage = power * 4; | ||
Line 13: | Line 11: | ||
damage += ( power - 1 ) * 2; | damage += ( power - 1 ) * 2; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
+ | The speed at which a bullet travels is defined by the following formula. | ||
+ | <syntaxhighlight> | ||
+ | speed = 20 - 3 * power; | ||
+ | </syntaxhighlight> | ||
Line 22: | Line 24: | ||
*[[Bullet Shadow]] | *[[Bullet Shadow]] | ||
+ | [[Category:Terminology]] | ||
[[Category:Robocode API]] | [[Category:Robocode API]] |
Latest revision as of 15:06, 18 February 2013
This article is a stub. You can help RoboWiki by expanding it. |
This article may require cleanup to meet RoboWiki's quality standards. Please improve this article if you can.
|
A bullet in Robocode is a line segment from the point where the bullet starts a tick, to the point where it finishes it. If that segment intercepts a robot the bullet is destroyed and the robot hit takes damage. The robot that fired the bullet gains three times the bullet's power in energy.
A bullet can have a power between 0.1 and 3. When it is fired the firing robot's energy reduces by the power. If a bullet hits another bullet, they are both destroyed.
The damage done to the opponent uses the following formula. Unless the opponent has less energy then this, in which it destroys the enemy outright.
damage = power * 4;
if(power > 1)
damage += ( power - 1 ) * 2;
The speed at which a bullet travels is defined by the following formula.
speed = 20 - 3 * power;
This page is dedicated for describing the robocode.Bullet