map.TestCollision
Overview
- map.Draw
- map.DrawRectangle
- map.Height
- map.Load
- map.TestCollision
- map.TestMoveX
- map.TestMoveY
- map.TestPoint
- map.Width
Test if the region has collided with a map tile.
Syntax
map.TestCollision(x, y, w, h)
Parameters
x
- Horizontal position of the rectangle.y
- Vertical position of the rectangle.w
- Width of the rectangle.h
- Height of the rectangle.
Returns
True if collision occurred, otherwise false.
About
LameMap has collision support built in. You can test whether
or not collision has occurred with map.TestCollision
, passing
the rectangle to test.
Only valid map regions are tested for collisions; positions that are off the map area will always return 0.