pythonarcade / community-rpg

Open-Source RPG using the Python computer language and the Arcade graphics library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Cats do not use vertical movement texture data

pushfoo opened this issue · comments

commented

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:
image

To Reproduce
Steps to reproduce the behavior:

  1. Launch game
  2. Watch until a cat decides to move up or down

Expected behavior
Texture data for vertical movement is used when moving up or down

commented

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.

commented

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.

commented

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.

commented

Testing indicates that up and down data now gets used for cats and dogs. 👍