Open seisatsu opened 7 years ago
I made an entity that is 36 pixels tall and am seeing some odd behaviors:
Found an issue.
When an entity is being drawn, the (entity.x, entity.y) coordinate represents the top-left corner of the bottom tile where the entity is standing. This is how tall entities were originally envisioned. All entities would have a 1×1 tile base but their graphics could be taller and that would cause them to appear tall. (The specific code here is the code that revolves around the tall_amount
variable in AreaManager.__build_frame
.)
But inside entity._tile_cross()
and friends, the (entity.x, entity.y) coordinate represents the top-left of the whole entity.
They disagree!
Let's separate the concepts of entity size and entity graphic size. All entities are 1×1 tile in size. We'll handle big and small entities in #91. For now, an entity's graphic, which can be of any size, is anchored to the bottom center of the entity and can extend up, left, and right from the entity.
This is an expansion of the tall entity concept. It keeps compatibility with the current player.png sprite.
I had already assumed the problem with tall entities. Let's go ahead and do what you just said.
I think #137 will fix this issue, too.
With pixel mode tile collision, do entities actually always collide with the center of the tile, or will a really wide or really tall entity collide in the wrong place? We have only tested with entities about the size of a tile.
A FIXME comment has been added to the function.