Simplex Noise Game Objects
Demonstrates how to create and display 2D and 3D Simplex noise patterns as Game Objects in your scene.
1280 × 720
class Example extends Phaser.Scene
{
create()
{
const { width, height } = this.scale;
this.add.noisesimplex2d({
noiseCells: [ 8, 9 ],
}, width / 4, height / 2, width / 2, height);
this.add.noisesimplex3d({
noiseCells: [ 8, 9, 8 ],
}, width * 3 / 4, height / 2, width / 2, height);
this.add.text(10, 10, '2D', { fontSize: 24 }).setStroke('#ff8844', 2).setShadow(2, 2, '#333333', 2, true, false);
this.add.text(width / 2 + 10, 10, '3D', { fontSize: 24 }).setStroke('#ff8844', 2).setShadow(2, 2, '#333333', 2, true, false);
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.WEBGL,
parent: 'game-container',
width: 1280,
height: 720,
scene: Example
};
const game = new Phaser.Game(config);