Hi all, new here. I'm wondering if someone can point me in the direction of best practices to animating
a multi tile character sprite: Do you use a function with multiple calls to spr() and a timer or pack a table etc.
thanks.



When you call spr(), the two arguments after the x and y coordinate are how many sprites wide and tall to use when drawing the sprite. So, for example, if the top-left of your sprite starts at Sprite #001 and is two sprites wide and tall, you would use spr(1,30,30,2,2) and that would place the whole 16px by 16px sprite at 30,30 on the screen.



For animating, you can use this method:
https://mboffin.itch.io/simple-animation
This method works fine for multi-tile sprites. You just use the extra arguments for width and height when you call spr() and make sure the table of sprites is filled with the top-left corner sprite numbers.
[Please log in to post a comment]