Discussion:
getTime()
joshua mensink
2014-03-15 21:07:53 UTC
Permalink
My Robot will chase bots around the outside similar to the walls sample bot
but sometimes when it chases another bot it will fire a couple shots into
the wall because the other bot is just far enough ahead to try around teh
corner before they get there. I want to say onMissedBullets event if the
time between X amount of bullets is short then turn around and start
chasing a different robot. I don't think i understand How the Time works in
Robocode could someone help???
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
fnl
2014-03-16 21:19:52 UTC
Permalink
I am not sure if I understand your question. But I will give it a try.

Time in Robocode is measured in turns. So first turn is turn one, then
follows turn 2, turn 3, turn 4 and so on. Every robot needs to call tell
Robocode what to do, e.g. turnLeft(90), ahead(10) etc. At the end of a
turn, a robot must call execute() either directly or indirectly.

Please notice that the speed of the bullet depends on the bullet power,
i.e. bullet speed = (20 - 3 * bullet power). So when you fire a heavy
bullet with power = 3, the bullet will move 20 - 3 * 3 = 11 units/turn. If
the bullet power = 0.1, the speed is 20 - 3 * 0.1 = 19.7 units/turn.
You can use this to calculate how many turns it will take a bullet to
travel from your robot to some point from the distance to that point (or
robot): number of turn = distance / speed. Also notice that the robot will
properly be moving. So the final distance will be greater.

I recommend that you study the articles on the RoboWiki
<http://robowiki.net/>regarding targeting<http://robowiki.net/wiki/Targeting>,
which contains basically everything you need to get started. :-)

Cheers,
- Flemming
Post by joshua mensink
My Robot will chase bots around the outside similar to the walls sample
bot but sometimes when it chases another bot it will fire a couple shots
into the wall because the other bot is just far enough ahead to try around
teh corner before they get there. I want to say onMissedBullets event if
the time between X amount of bullets is short then turn around and start
chasing a different robot. I don't think i understand How the Time works in
Robocode could someone help???
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...