Class: Tile

Newtonian. Tile

A Tile in the game that makes up the 2D map grid.

new Newtonian.Tile()

Initializes a Tile with basic logic as provided by the Creer code generator. Never use this directly. It is for internal Joueur use.

Extends

Members

number blueium

The amount of blueium on this tile.

number blueiumOre

The amount of blueium ore on this tile.

number decoration

(Visualizer only) Different tile types, cracked, slightly dirty, etc. This has no effect on gameplay, but feel free to use it if you want.

string direction

The direction of a conveyor belt ('blank', 'north', 'east', 'south', or 'west'). Blank means conveyor doesn't move.

string gameObjectName

Inherited From:
Newtonian.GameObject#gameObjectName
String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.

string id

Inherited From:
Newtonian.GameObject#id
A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.

boolean isWall

Whether or not the tile is a wall.

Array.<string> logs

Inherited From:
Newtonian.GameObject#logs
Any strings logged will be stored here. Intended for debugging.
The Machine on this Tile if present, otherwise null.
The owner of this Tile, or null if owned by no-one. Only for generators and spawn areas.

number redium

The amount of redium on this tile.

number rediumOre

The amount of redium ore on this tile.

Newtonian.Tile tileEast

The Tile to the 'East' of this one (x+1, y). Null if out of bounds of the map.

Newtonian.Tile tileNorth

The Tile to the 'North' of this one (x, y-1). Null if out of bounds of the map.

Newtonian.Tile tileSouth

The Tile to the 'South' of this one (x, y+1). Null if out of bounds of the map.

Newtonian.Tile tileWest

The Tile to the 'West' of this one (x-1, y). Null if out of bounds of the map.

string type

The type of Tile this is ('normal', 'generator', 'conveyor', or 'spawn').
The Unit on this Tile if present, otherwise null.

number x

The x (horizontal) position of this Tile.

number y

The y (vertical) position of this Tile.

Methods

Array.<string> directions()

Gets the valid directions that tiles can be in, "North", "East", "South", or "West"
Returns: Array.<string>
"East", "South", and "West"

Array.<Tile> getNeighbors()

Gets the neighbors of this Tile
Returns: Array.<Tile>
The neighboring (adjacent) Tiles to this tile

boolean hasNeighbor()

Checks if this Tile has a specific neighboring Tile
Returns: boolean
if the tile is a neighbor of this Tile, false otherwise

boolean isPathable()

Checks if a Tile is pathable to units
Returns: boolean
True if pathable, false otherwise

log(message)

Inherited From:
Newtonian.GameObject#log
Adds a message to this GameObject's logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.
Name Type Description
message string A string to add to this GameObject's log. Intended for debugging.

string toString()

Inherited From:
BaseGameObject#toString
toString override for easier debugging
Returns: string
readable string in the format `GameObjectName #id`