Hi,
I’m confused about what the following is saying. Could someone make a simple mockup of a player with these points plotted on the image?
In this sample the player is a rectangle 32 pixels across and 32 pixels wide with an
offset of -16 in the Y direction.
The origin of a sprite is it’s center, but in this case, due to the -16 pixel offset, the
origin of the sprite as reckoned by MTE is 16 pixels from the bottom of the sprite, or
the center of the lower tile in the stack.
To detect platforms and obstacles around the player we must define points around the
player to be checked by our code. There are many ways to do this, but in this example the
points are defined in relation to the player sprite. The top1 and top2 points are along
the top of the player sprite. The sprite is 32 pixels high and the origin is 16 pixels from
it’s bottom, so the top is -16 pixels from the origin. The rest of the points are defined
in the same manner.
]]–
local offsets = {top1 = {-12, -16},
top2 = {12, -16},
bottom1 = {-12, 16},
bottom2 = {12, 16},
left1 = {-16, -12},
left2 = {-16, -32},
right1 = {16, -12},
right2 = {16, -32}
}