sprite is following a path
Problem it solves
You want to check if an enemy is currently walking along a patrol route before giving it a new destination or triggering an idle animation.
What this block does
Checks whether the given sprite is currently actively following a path.
The block
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The sprite to check. |
Returns
boolean — true if the sprite is currently following a path, false otherwise.
Example
let mySprite = sprites.create(img`.`, SpriteKind.Enemy)
if (scene.spriteIsFollowingPath(mySprite)) {
mySprite.sayText("On my way!")
}Add the extension
Add github:jwunderl/arcade-tilemap-a-star to your project, or open: Import arcade-tilemap-a-star.