How to use the level/cells.js.Grass function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ondras / sleeping-beauty / src / js / ui / map / memory.js View on Github external
import * as cells from "level/cells.js";
import pc from "being/pc.js";

const GRASS_1 = new cells.Grass("\"");
const GRASS_2 = new cells.Grass("'");
const TREE = new cells.Tree();

const NOISE = new ROT.Noise.Simplex();

const memories = {};

function darken(color) {
	if (!color) { return color; }
	return ROT.Color.toRGB(ROT.Color.fromString(color).map(x => x>>1));
}

export default class Memory {
	static forLevel(level) {
		if (!(level.id in memories)) { memories[level.id] = new this(level); }
		return memories[level.id];
	}
github ondras / sleeping-beauty / src / js / ui / map / memory.js View on Github external
import * as cells from "level/cells.js";
import pc from "being/pc.js";

const GRASS_1 = new cells.Grass("\"");
const GRASS_2 = new cells.Grass("'");
const TREE = new cells.Tree();

const NOISE = new ROT.Noise.Simplex();

const memories = {};

function darken(color) {
	if (!color) { return color; }
	return ROT.Color.toRGB(ROT.Color.fromString(color).map(x => x>>1));
}

export default class Memory {
	static forLevel(level) {
		if (!(level.id in memories)) { memories[level.id] = new this(level); }
		return memories[level.id];