Skip to content

Perlin

The Perlin noise module allows to create perlin noise values for x/y coordinates.

Usage

To use this class, add the following require at the top of your script:

local Perlin = require 'engine/math/perlin'

Reference

setSeed

static setSeed(newSeed)

Set perlin noise seed. Perlin noise is initially seeded with seed value 0

Parameters

  • newSeed (number): the new seed value for perlin noise.

noise

static noise(x, y)

Create a perlin noise value for x and y coordinates

Parameters

  • x (number): the X coordinate for the perlin noise
  • y (number): the Y coordinate for the perlin noise

Returns

  • number: perlin noise value