LuaTile

class LuaTile
collides_with(layer) What type of things can collide with this tile?
valid :: boolean [R] Is this object valid?
name :: string [R] Prototype name of this tile.

A single "square" on the map.

collides_with(layer)

What type of things can collide with this tile?

Parameters
layer :: string: Possible values:
  • "ground-tile"
  • "water-tile"
  • "resource-layer"
  • "floor-layer"
  • "object-layer"
  • "player-layer"
Example
Check if the player would collide with a tile
game.local_player.print(tostring(game.local_player.surface.get_tile(1, 1).collides_with("player-layer")))
valid :: boolean [Read-only]

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.

name :: string [Read-only]

Prototype name of this tile. E.g. "sand-dark" or "grass-dry".