Closed parsehex closed 7 years ago
I wonder if it could be that pine cones are placed in the middle of the cursor's graphic moving? Pine cone placement is based off of {x, y} = cursor.graphic
, so if the graphic's coords are in the middle of tweening it would make sense that pine cones (or any placeable item) could be placed off-grid.
This wouldn't explain though why the "between-placements" are always exactly between tiles instead of a more random offset (which would be likely if the coordinates are mid-tween).
In sprites/Common
, all sprites are "aligned" to the world with a lazy line:
const alignedCoords = alignToGrid({ x, y });
I've known for a while that this function will return coordinates that are not actually aligned to the grid. All it does is ensure that the coordinates are divisible by 16, causing these misplacements to either align to the center of a tile, or the center of two tiles.
Will see if I can replicate this to some extent so I can make sure it's fixed.
Looks fixed
Has happened more than once in same playthrough.
It appears the object still has the correct tile set and the world is still keeping track of it correctly. The object is just placed at coordinate that was not tile-adjusted (add 16px to coordinates).