--- <tr><td>colors</td><td>{number}</td><td>table of colors (default color is 0x0000FF00, maximum count is 100, set is available in <a href="#init">init</a>)</td></tr>
--- <tr><td>food_consumed_natural</td><td>number</td><td>consumed food which appeared naturally in the world</td></tr>
--- <tr><td>food_consumed_hunted_self</td><td>number</td><td>consumed food from snakes that you killed</td></tr>
--- <tr><td>food_consumed_hunted_by_others</td><td>number</td><td>consumed food from snakes that were killed by others</td></tr>
--- <tr><td>colors</td><td>{number,..}</td><td>table of colors (default color is 0x0000FF00, maximum count is 100, set is available in <a href="#init">init</a>)</td></tr>
--- <tr><td>face</td><td>number</td><td>not implemented yet (returns 0, set is available in <a href="#init">init</a>)</td></tr>
--- <tr><td>logo</td><td>number</td><td>not implemented yet (returns 0, set is available in <a href="#init">init</a>)</td></tr></tr>
--- </tbody></table>
...
...
@@ -92,26 +86,32 @@ function init()
end
--- That function returns all food as list.
-- The list is ordered by food value, from largest to lowest.
-- @param max_distance all food within the distance is included
-- @param minimum_food_value all lower food values are filtered (min: 0, max: unknown)
-- @usage local food = findFood(max_distance, 0.8)
-- for i, item in food:pairs() do
-- item.d -- angle in radian
-- item.d -- angle in radian (-π to +π)
-- item.dist -- distance
-- item.v -- food value
-- end
functionfindFood(max_distance,minimum_food_value)
end
--- That function returns all segments of all snakes within a certain radius as list.
-- All attributes of each item in the segments list are measured between the center of your head the the center of the item center.
-- The list is ordered by distance, from smallest to largest. All attributes of each
-- item in the segments list are measured between the center of your head the the center
-- of the item center.
-- @param max_distance all segements within that distance are included
-- @param include_own If true, your snake segments are included. Otherwise you get only enemy segments
-- @usage local segments = findSegments(50.0, false)
-- for i, item in segments:pairs() do
-- item.d -- angle in radian
-- item.r -- radius of the item
-- item.dist -- distance
-- item.bot -- id of the other snake
-- item.d -- angle in radian (-π to +π)
-- item.r -- radius of the item
-- item.dist -- distance
-- item.bot -- id of the other snake (new one after death)
-- item.bot_id -- id of the other snake (new one after death)
-- item.bot_name -- name of the other snake (will never change)
-- end
functionfindSegments(max_distance,include_own)
end
...
...
@@ -121,12 +121,12 @@ end
functionlog(message)
end
--- That function is called each frame.
--- That function (defined by you) is called each frame.
-- Here you can implement you bot logic. The return value must be an radiant angle.
-- A negative angle means turn left and a positive angle
-- means turn right. With 0, the snake keeps its direction.
-- @return new angle relative to the head direction
--@return if true the snake will use boost, otherwise false or empty (optional)
--@return if true the snake will use boost, otherwise false or empty (optional)