BlocosIA Wiki Editor

Smart Sprites

Speed, movement prediction, follow, flee, path finding in mazes and field of view.

To use it: in the editor, click "Extensions" (bottom corner) and add "Smart Sprites".

Reporter

speed [total] of [ ▾ ]

Gives a number or text. Put it inside a round slot.

Boolean

is [ ▾ ] moving?

Answers true or false. Use it in "if", "repeat until" and "wait until".

Reporter

motion direction of [ ▾ ]

Gives a number or text. Put it inside a round slot.

Reporter

predict [x] of [ ▾ ] in ( ) secs

Gives a number or text. Put it inside a round slot.

Reporter

direction to [ ▾ ]

Gives a number or text. Put it inside a round slot.

Reporter

nearest sprite

Gives a number or text. Put it inside a round slot.

Stack

move towards [ ▾ ] ( ) steps

Does an action. Snap it below another block.

Stack

run away from [ ▾ ] ( ) steps

Does an action. Snap it below another block.

Stack

walk ( ) steps along the path to [ ▾ ] (avoiding walls)

Walks the shortest path to the nearest sprite with that name, avoiding solid map blocks and barriers (A*).

Stack

walk ( ) steps along the path to x: ( ) y: ( )

Walks the shortest path to a point x, y, avoiding walls.

Boolean

is there a path to [ ▾ ] ?

True if there is a free path to the target.

Boolean

can I see [ ▾ ] within ( ) steps (( ) degree view)?

True if the sprite is near, inside the vision cone (where I point) and with no wall in between. Use 360 degrees to see all around.

Stack

wander ( ) steps (avoiding walls)

Wanders around, changing direction now and then and avoiding walls and the edge.

Stack

patrol between x: ( ) y: ( ) and x: ( ) y: ( ) walking ( ) steps

Goes back and forth between two points (use inside a "forever").

Reporter

[distance] of the nearest [ ▾ ]

Distance, direction, x or y of the nearest sprite with that name (clones count).

Reporter

number of [ ▾ ] (with clones)

How many sprites with that name are on stage, counting clones.