BrightSign BrightScript 3.0 Reference Manual User Manual
Page 71

66
REM
REM construct a new snake BrightScript object
REM
Function
newSnake(x
As
Integer
, y
As
Integer
)
As
Object
' Create AA BrightScript Component; the container for a "BrightScript Object"
snake=CreateObject(
"roAssociativeArray"
)
snake.Draw=snkDraw
snake.TurnNorth=snkTurnNorth
snake.TurnSouth=snkTurnSouth
snake.TurnEast=snkTurnEast
snake.TurnWest=snkTurnWest
snake.MoveForward=snkMoveForward
snake.MakeLonger=snkMakeLonger
snake.AddSegment=snkAddSegment
snake.EraseEndBit=snkEraseEndBit
REM
REM a "snake" is a list of line segments
REM a line segment is an roAssociativeArray that conains a length and direction (given by the x,y delta needed to move as it is drawn)
REM
snake.seg_list = CreateObject(
"roList"
)
snake.AddSegment(1,0,3)
REM
REM The X,Y pos is the position of the head of the snake
REM