B
Blaize
Guest
I've recently adapted a Heartbeast tutorial for something I'm working on (here's the original) on grid collisions.
It works as far as collision checking goes, but my tiles in the room are layered so that I can get some illusion of depth.
Tile depth looks like (note that the OWorldCell is a macro):
and player depth (in the step event) looks like:
This is the result:
Bug_001a.jpg
If you look at A, the player object puts itself 1px into the next grid space which means that it will draw above the environment tile. The weird thing is it only happens occasionally since in B it's behaving just how I want it to be.
What's up with it?
It works as far as collision checking goes, but my tiles in the room are layered so that I can get some illusion of depth.
Tile depth looks like (note that the OWorldCell is a macro):
Code:
for (yy=0;yy<h;yy++)
{
for (xx=0;xx<w;xx++)
{
var visualTiles = tile_layer_find(999998,xx*OWorldCell, yy*OWorldCell);
if (visualTiles)
{
tile_set_depth(visualTiles,-yy*(OWorldCell));
}
}
}
Code:
depth = floor(-y);
Bug_001a.jpg
If you look at A, the player object puts itself 1px into the next grid space which means that it will draw above the environment tile. The weird thing is it only happens occasionally since in B it's behaving just how I want it to be.
What's up with it?
Attachments
-
197.4 KB Views: 7