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.

math constant

Problem it solves

You need a mathematical constant like π or e in a calculation without typing out a long decimal from memory.

What this block does

Returns a common mathematical constant: NaN, π, e, LN2, LN10, √1/2, or √2.

The block

Block ID: spriteutilmathconsts

$constType block

Parameters

NameTypeDefaultMeaning
constTypeConstsWhich constant to return

Returns

numberThe value of the selected constant.

Example

let pi = spriteutils.consts(spriteutils.Consts.Pi)
console.log(pi)

Add the extension

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