Couple people asked about how I did sprite rotation for josefnpat's collab cart https://www.lexaloffle.com/bbs/?tid=27582
Included is a sprite rotation function, and a way of layering them on top of each other to create an illusion of a 3d sprite.
Everything is commented, hopefully it's clear.
Enjoy, hope this is helpful for someone!
(the effect isn't perfect and can be a little unclear if you don't consider it when drawing sprites, if anyone has any more accurate examples of rotation functions I'd like to see!)
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/13845/blobby_g.png)
neat! and as good as you can get imho.
tried optimizing/rewriting rotsprite, stat(1) went from 0.36 to 0.30 on your cart:
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/13845/blobby_g.png)
just found out I had this optimized further but didn't update here:
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/13845/blobby_g.png)
not out of the box dw, also this works on single sprites (8x8).
sizes are hardcoded, but should be 'easily' adapted.
if somebody needs help about that, I can have a look, but I won't right now ;)
[Please log in to post a comment]