is sprite following path
Problem it solves
You want to check if an enemy is actively moving on a patrol before giving them a new command or changing their animation state.
What this block does
Checks whether a sprite is currently in the middle of navigating along a tilemap path.
The block
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The sprite to check. |
Returns
boolean — true if the sprite is actively following a path, false otherwise.
Example
let guard = sprites.create(img`.`, SpriteKind.Enemy)
if (TilemapPath.is_sprite_following_path(guard)) {
guard.sayText("On patrol!")
}Add the extension
Add github:UnsignedArduino/TilemapPath to your project, or open: Import TilemapPath.