when I press the left and right arrows, my sprite plays an animation that starts from sprite 1 to sprite 4, since the init function reports that sp=1.At the same time, there is a standard check if SP <4, then.However, I cannot reproduce the animation of sprites from 17 to 20 when I press the up arrow, because as soon as I say in the loop that SP = 17, the animated sprites overlap each other due to very fast sequential rendering.Could you please help fix this?Here is the code:
--player--
player={
x=63,
y=63,
f=false,
sp=1,
speed=1,
stimer=0
}
end
function _update()
--player movment--
if btn(➡️) then
player.x+=player.speed
player.f=fals
if player.stimer<10 then
player.stimer+=1
else
if player.sp<4 then
player.sp+=1
else
player.sp=1
end
player.stimer=0
end
end
if btn(⬅️) then
player.x-=player.speed
player.f=true
if player.stimer<10 then

