Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entity._tile_cross() doesn't work on entities bigger than a tile #138

Open
seisatsu opened this issue Apr 29, 2017 · 5 comments
Open

entity._tile_cross() doesn't work on entities bigger than a tile #138

seisatsu opened this issue Apr 29, 2017 · 5 comments
Labels
Milestone

Comments

@seisatsu
Copy link
Member

seisatsu commented Apr 29, 2017

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.

@pmer
Copy link
Member

pmer commented Apr 29, 2017

I made an entity that is 36 pixels tall and am seeing some odd behaviors:

  • When coming down from the top, I am stopped several pixels up from the tree in http://i.imgur.com/5Cm8A4V.png.
  • When coming from the bottom, I can step on top of the tree.
  • When coming from the side, it's the same as an 18-pixel-high entity.
  • I get stuck on the edge of areas after taking an exit.

@seisatsu seisatsu modified the milestone: Alpha-0.0.8 Apr 29, 2017
@seisatsu seisatsu changed the title Does entity._tile_cross() work on entities much bigger than the tile? Does entity._tile_cross() work on entities much bigger than the tile? (no) Apr 29, 2017
@seisatsu seisatsu added bug and removed investigate labels Apr 29, 2017
@pmer pmer changed the title Does entity._tile_cross() work on entities much bigger than the tile? (no) entity._tile_cross() doesn't work on entities bigger than a tile May 2, 2017
@pmer
Copy link
Member

pmer commented May 2, 2017

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!

@pmer
Copy link
Member

pmer commented May 2, 2017

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.

@seisatsu
Copy link
Member Author

seisatsu commented May 2, 2017

I had already assumed the problem with tall entities. Let's go ahead and do what you just said.

@seisatsu seisatsu modified the milestones: Alpha-0.0.8, Alpha-future May 17, 2017
@pmer
Copy link
Member

pmer commented Oct 10, 2017

I think #137 will fix this issue, too.

@pmer pmer self-assigned this Oct 10, 2017
@seisatsu seisatsu modified the milestones: Alpha-future, Alpha-0.0.12 Oct 25, 2017
@seisatsu seisatsu modified the milestones: Alpha-0.0.12, Alpha-future Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants