Oh, hello! How to you animate 16x16 sprites? im trynig putting a "+1" on the spr function for wide and hight but prints more sprites on the spritesheet! (glitchy) spr(p.sp[p.f],x,y,p.sp[p.f]+1,p.sp[p.f]+1)
I think this could be made a bit smaller by making use of FLR() to divide the modulos. Since it's one-sprite, maybe don't need 2-variables to keep track of it ? Maybe ...
← Return to game
Comments
Log in with itch.io to leave a comment.
I was struggling to animate 16x16 sprites until I used your code.
Massive Thanks!
Oh, hello! How to you animate 16x16 sprites? im trynig putting a "+1" on the spr function for wide and hight but prints more sprites on the spritesheet! (glitchy)
spr(p.sp[p.f],x,y,p.sp[p.f]+1,p.sp[p.f]+1)
You would just use spr(p.sp[p.f], x, y, 2, 2) where the 2,2 indicates the width and height (in units of 8x8 sprites) of the sprite you want to draw.
thank you so much!
Thank you for this tutorial!
Also, there is a syntax error in line 3 (a dot before
p.f
).Very good explanation, thank you!
I think this could be made a bit smaller by making use of FLR() to divide the modulos. Since it's one-sprite, maybe don't need 2-variables to keep track of it ? Maybe ...
Exactly what I needed! Thank you very much!
Modulus is totally the secret sauce. You just reduced my 2 hour struggle to figure that out into a handful of code. Thanks!
this is excellent , and general purpose. thank you!