MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Tilemap A* Pathfinding

Smart pathfinding for tilemaps that lets sprites calculate routes around walls and follow paths automatically.

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

sprite $sprite is following a path block

Parameters

NameTypeDefaultMeaning
spriteSpritemySpriteThe 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.