Bug: Cats do not use vertical movement texture data
pushfoo opened this issue · comments
Describe the bug
Cats do not use the texture data for vertical movement. This data is included in their sprite sheets, but never used in-game:
To Reproduce
Steps to reproduce the behavior:
- Launch game
- Watch until a cat decides to move up or down
Expected behavior
Texture data for vertical movement is used when moving up or down
This may also extend to NPCs in general, but we do not currently have any moving NPCs other than cats.
A question that maybe makes sense for this, this is easy if it is only ever moving in one direction(left, right, up, down) but what happens when it's moving at an angle, say left and up at the same time, do we use the left facing or the up facing texture?
Obviously this could be solved by having textures for those angled directions, but those do not exist in the current spritesheet(at least for the cat specifically, but probably also for other characters). This can maybe be partially solved by switching some things to a more complete set of sprites from kenney.nl? We would definitely still have to build some logic in to handle the various directions other than left or right.
For the alignment question you brought up, I think matching the sprite to the nearest or most recent movement vector change would be fine. I think the player character behaves that way right now, but not the cats.
Building more refined state and animation tracking into the sprites is also worth considering. We hardcode frame numbers right now. 🙃
I'm working on this.
Testing indicates that up and down data now gets used for cats and dogs. 👍