Created
July 29, 2021 23:21
-
-
Save ISSOtm/88e0174d3be338e832c11112172d08d7 to your computer and use it in GitHub Desktop.
Metasprite animation definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MACRO nb_cels | |
REDEF NB_CELS equs "_NB_CELS\@" | |
db {NB_CELS} | |
DEF {NB_CELS} = 0 | |
ENDM | |
MACRO cel | |
db (\1) ; Amount of frames to display this cel during | |
REDEF {NB_CELS} = {NB_CELS} + (\1) | |
dw (\2) ; Ptr to cel | |
ENDM | |
PlayerDownWalkingDraw: | |
nb_cels ; Total animation length (it wraps after this) | |
cel $10, PlayerDownStandingFrame | |
cel $10, .frame0 | |
cel $10, PlayerDownStandingFrame | |
cel $10, .frame1 | |
; (it would be nice to also guarantee that $40 = $10 + $10 + $10 + $10 somehow) | |
MACRO nb_objs | |
REDEF _NUM_OBJS EQUS "_NUM_OBJS_\@" | |
db {_NUM_OBJS} | |
DEF {_NUM_OBJS} = 0 | |
ENDM | |
MACRO obj | |
db (\1), (\2), (\3), (\4) ; y, x, tile, attr | |
REDEF {_NUM_OBJS} = {_NUM_OBJS} + 1 | |
ENDM | |
dw PlayerDownWalkingTiles ; ... the player is a bit special, ignore this | |
.frame0 | |
nb_objs | |
obj -27, -12, 0, 0 ; (-12, -27) from the actor position, which is between its feet | |
obj -27, -4, 2, 0 | |
obj -27, 4, 4, 0 | |
obj -11, -8, 6, 0 | |
obj -11, 0, 8, 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment