Re: getTime()
fnl <[email protected]>
| Newsgroups | gmane.comp.java.robocode |
|---|---|
| Message-ID | <[email protected]> |
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 Den lørdag den 15. marts 2014 22.07.53 UTC+1 skrev 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 [email protected]. For more options, visit https://groups.google.com/d/optout.