NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

ants.colony()

Syntax

colony(n, x, y, r)

Description

Returns a new ant colony consisting of n ants. The colony's location is at coordinates x and y and has a territorial radius of r. Once ants venture beyond r they will turn back to the colony.

The colony has three useful properties:

Example

ants = ximport("ants")
colony = ants.colony(30, WIDTH/2, HEIGHT/2, 100)