Robocode/Game Physics
< Robocode
Jump to navigation
Jump to search
Revision as of 14:05, 28 November 2007 by FlemmingLarsen (talk | contribs)
This article is a stub. You can help RoboWiki by expanding it. |
This page describes the game physics of Robocode
Robocode Game Physics
Robocode Processing Loop
The order that Robocode runs is as follows:
- Battle view is (re)painted
- All robots execute their code until they take action (and then paused)
- Time is updated (time = time + 1)
- All bullets move and check for collisions
- All robots move (heading, accelration, velocity, distance, in that order)
- All robots perform scans (and collect team messages)
- All robots are resumed to take new action
- Each robot is processing its event queue
Time and distance measurements in Robocode
Time (t) | Robocode time is measured in "ticks". Each robot gets one turn per tick. 1 tick = 1 turn. |
Distance Measurement | Robocode's units are basically measured in pixels, with two exceptions. First, all distances are measured with double precision, so you can actually move a fraction of a pixel. Second, Robocode automatically scales down battles to fit on the screen. In this case, the unit of distance is actually smaller than a pixel. |