MakeCode Games!

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

← Back to extensions

Retro FX

Add juicy 8-bit sound synthesizers, screen shakes, particle explosions, camera effects, and retro text displays to your games.

variation from table

Problem it solves

You want an enemy to shoot bullets at specific speeds picked randomly from a preset table like [50, 75, 100].

What this block does

Picks and returns one random number from an array of numbers.

The block

Block ID: retro_variation_table

variation from table $values block

Parameters

NameTypeDefaultMeaning
valuesnumber[][10, 20, 30]A list of numbers to choose from.

Returns

number — A randomly selected number from the list, or 0 if empty.

Example

let speed = Retro.variationTable([50, 75, 120])
console.log(speed)

Add the extension

Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.