Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upLeft/right sprite flipping in iso mode. Run and crouch overlay. Minor extras. #31439
Conversation
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: |
This comment has been minimized.
This comment has been minimized.
|
Nice, minor thing, needs astyling. |
ZhilkinSerg
added
<Bugfix>
Mods
SDL: Tiles / Sound
labels
Jun 15, 2019
This comment has been minimized.
This comment has been minimized.
|
Yes, thank you! This is something i wanted for a long time! |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the kind words! – I am undeserving as I keep forgetting to astyle! :) I am full of ambition to improve my citizenship. I'll fix! (The chipper tone here is due to recent consumption of coffee (hot) and not intended to be sarcastic :) ) |
This comment has been minimized.
This comment has been minimized.
|
There we go! I also notice that my Summary line could be improved – thanks Night-Pryanik! :) |
This comment has been minimized.
This comment has been minimized.
|
You are welcome! |
ZhilkinSerg
self-assigned this
Jun 15, 2019
This comment has been minimized.
This comment has been minimized.
|
@AnthonBerg Yeah, |
AnthonBerg commentedJun 15, 2019
•
edited by Night-Pryanik
add isometric branches to facing-left/facing-right calculations for monsters and player (including actions and ranged). The calculations are reasonably simple and fast.
enable sprite flipping in isometric mode when appropriate
clarify to-flip-or-not-to-flip code for right/left-facing stuff
flip all entity and overlay sprites in hitbutton_iso so they are facing right like in all the other tilesets :)
add run and crouch tile overlay support
add run and crouch overlay tiles to hitbutton_iso tileset
add parameter comments to some function calls that have many parameters
sneak brainless zombie sprite into hitbutton_iso tileset
bonus: unshadow a couple of variables in a big tile-drawing function (x, y, col)
Summary
SUMMARY: Interface "Left/right sprite flipping in iso mode, run and crouch overlay"Purpose of change
Until now it has only been in non-isometric mode that sprites have been flipped right/left to match orientation. Here's an attempt at addressing that. Run and crouch sprite overlay support is also added, as well as tiles to support it in hitbutton_iso.
Describe the solution
Added simple and fast logic to get the left/right movement in isometric space. Added iso logic to sprite-orientation draw calls to allow horizontal flipping. (Still no rotation or vertical flipping in iso mode.) Clarified some code a little bit too.
Also flipped all entity sprites in hitbutton_iso to be RIGHT-facing instead of left-facing. All the other tilesets have right-facing sprites out of the box.
We also add a RUN and CROUCH overlay tile support.
Plus some comments and cleanup, and a brainless zombie sprite.
Sending this in as one big pull request. My apologies. Thanks for your patience. The thing is that because of the sprite flipping that was required for hitbutton_iso, untangling this into separate PRs was a noticeable amount of hassle. The work came about in a long hacking session. Maybe this is all decent enough to be accepted as-is? If it's hard to work with this PR as is I'll rework it. Thanks.
I see these as only small changes that bring out the expressivity that's already in the engine. L/R facing sprites, sees-player alerts, and run/crouch overlays add A LOT to the gameplay in isometric mode.
Additional context
Screenshots:
Little computer person running to the left with lots of zombies approaching from both sides. Most of the zombies see the player, except some brainless zombies.

Little computer person crouches behind a road roller. Most of the zombies don't see us anymore.
