MakeCode Games!

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

← Back to extensions

Sprite Utils

A grab-bag of sprite math and rendering helpers for MakeCode Arcade: distances, angles, movement, timers, and simple drawing.

point (x, y)

Problem it solves

Several blocks in this extension (like `move to` or `place angle from`) need a plain location, not a sprite, but Arcade doesn't have a simple built-in "point" value.

What this block does

Creates a reusable point value at the given x, y coordinates.

The block

Block ID: spriteutilpoint

x $x y $y block

Parameters

NameTypeDefaultMeaning
xnumberX coordinate
ynumberY coordinate

Returns

util.PointA point that can be used anywhere a location is expected.

Example

let target = spriteutils.point(80, 60)
console.log(target.x)

Add the extension

Add github:jwunderl/arcade-sprite-util to your project, or open: Import arcade-sprite-util.