Log In  
Follow
Flowpix
[ :: Read More :: ]

Hello everyone.Please tell me, is there a way to import a sprite in png format to pico 8 EE?

P#131039 2023-06-16 17:38

[ :: Read More :: ]

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
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.y-=player.speed
print(player.sp)
if player.stimer<10 then
player.stimer+=1
else
player.sp=17
if player.sp<20 then
player.sp+=1
else
player.sp=17
end
player.stimer=0
end
function _draw()
cls()
map()
spr(player.sp,player.x,player.y,1, 1,player.f)
end

P#130206 2023-05-27 07:11

Follow Lexaloffle:          
Generated 2024-04-16 17:46:24 | 0.075s | Q:6