MakeCode Games!

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

← Back to extensions

Tilemap Path

Create multi-point waypoint paths on tilemaps for sprites to follow with built-in obstacle avoidance.

set path

Problem it solves

You want to update an existing patrol route with a new set of destinations without needing to create a brand new path variable.

What this block does

Replaces the list of tile locations in an existing path object and recalculates the routes between them.

The block

$tmpath set path to $path block

Parameters

NameTypeDefaultMeaning
tmpathTilemapPathpathThe path object you want to update.
pathtiles.Location[]nullThe new list of tile locations to visit in order.

Example

let myPath = TilemapPath.create_path([tiles.getTileLocation(1, 1)])
TilemapPath.set_path(myPath, [tiles.getTileLocation(3, 3), tiles.getTileLocation(6, 6)])

Add the extension

Add github:UnsignedArduino/TilemapPath to your project, or open: Import TilemapPath.