Docs: Difference between revisions
Appearance
m added more vara |
m added more vars |
||
| Line 201: | Line 201: | ||
"}"; | "}"; | ||
} | } | ||
</syntaxhighlight> | |||
|- | |||
|styles | |||
|An object which controls the colors used within a world. | |||
|<syntaxhighlight lang="javascript"> | |||
//Sets the public tile color to red. | |||
styles.public = "red"; | |||
renderTiles(true); | |||
</syntaxhighlight> | |||
|<syntaxhighlight lang="javascript" line="1" start="60"> | |||
var styles = defaultStyles(); | |||
</syntaxhighlight> | |||
|- | |||
|nextObjId | |||
|An integer used to track edits. | |||
|<syntaxhighlight lang="javascript"> | |||
//Writes the character "█" at the cursorCoords location, then updates the nextObjId id | |||
const [tileX, tileY, charX, charY] = cursorCoords; | |||
console.log(currentPosition) | |||
const editArray = [tileY, tileX, charY, charX, getDate(),"█", nextObjId] | |||
writeBuffer.push(editArray); | |||
nextObjId++; | |||
</syntaxhighlight> | |||
|<syntaxhighlight lang="javascript" line="1" start="61"> | |||
var nextObjId = 1; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||