Collision > Collision Points


Loop Over Each Point

For each collision point ...

foreachpoint-block

Loops over each collision point in the current collision event.

for(point in event.points) {
  [ACTIONS]
}

Collision Point

point-block

Returns the (x,y) position of the current collision point. Must be used within the for each collision point... wrapper.

Engine.toPixelUnits(point.x)
Engine.toPixelUnits(point.y)

Get Data for Collided Tile

data-block

Returns the text associated with the tile you collided with. Must be used within the for each collision point... wrapper.

What is this for? You can tag tiles with textual data that can be accessed during game. For example, a lava tile could convey that it's deadly to the touch, or a healing tile in an RPG could heal the character passing over it.
tile-editor

getTileDataForCollision(event, point)