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.

null-like constant

Problem it solves

Blocks don't normally have a way to produce the special values `undefined` or `null` directly.

What this block does

Returns either `undefined` or `null`, for the rare cases blocks-only projects need one of these values.

The block

Block ID: spriteutilnullconsts

$constType block

Parameters

NameTypeDefaultMeaning
constTypeNullConstsundefined or null

Returns

undefinedThe selected null-like value.

Example

let nothing = spriteutils.nullConsts(spriteutils.NullConsts.Undefined)
console.log(nothing)

Add the extension

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