Hello again!
I've two declarations like this:
So I can set the idle animation in this way:
Now, there is a way to put the address of "an_player_idle" in a variable so I can change it at runtime and so doing something like this:
LDA an_player_idle
STA MY_VARIABLE
SetAnIdleLoop:
LDA MY_VARIABLE, y
STA SPRITE_RAM, x
Thanks!
I've two declarations like this:
Code:
an_player_idle:
.db $00,$01,$10,$11,$20,$21,$30,$31,$40,$41
an_player_walk:
.db $04,$05,$14,$15,$24,$25,$34,$35,$44,$45
.db $00,$01,$10,$11,$20,$21,$30,$31,$40,$41
an_player_walk:
.db $04,$05,$14,$15,$24,$25,$34,$35,$44,$45
So I can set the idle animation in this way:
Code:
SetAnIdle:
LDX #$01
LDY #$00
SetAnIdleLoop:
LDA an_player_idle, y
STA SPRITE_RAM, x
INY
INX
INX
INX
INX
CPX #$2D
BNE SetAnIdleLoop
LDX #$01
LDY #$00
SetAnIdleLoop:
LDA an_player_idle, y
STA SPRITE_RAM, x
INY
INX
INX
INX
INX
CPX #$2D
BNE SetAnIdleLoop
Now, there is a way to put the address of "an_player_idle" in a variable so I can change it at runtime and so doing something like this:
Code:
LDA an_player_idle
STA MY_VARIABLE
SetAnIdleLoop:
LDA MY_VARIABLE, y
STA SPRITE_RAM, x
Thanks!