World Cells![]() Cell![]() ![]() CellShape![]() ![]() ColorTable![]() ![]() Tags![]() ![]() Text |
A rectangular stationary object that can interact with other objects.
All Cell objects belong to the Cells collection object. Additionally, a Cell object can belong to one or more Region collection objects.
The following example creates a checkered board pattern using the Cell object and the Cells collection object.
Private Sub World1_OnSimBegin(ByVal World As World, ByVal Worms As Bots, ByVal Cells As Cells)
Cells.Color = vbtBlack
For Each Cell in Cells
If IsEven(Cell.RowIndex + Cell.ColumnIndex) then
Cell.Color = vbtRed
End If
Next Cell
End Sub
Function IsEven(ByVal Number as Long) as Boolean
If Number Mod 2 = 0 Then IsEven = true Else IsEven = false
End Function