What commands can i use? I use btn(0) and so on for player 1 but for player 2 btn(s) doesnt work for example.
try btn(0, 1) to get the 0th button for the second player.
Cool! I cant get the other buttons to work. SHouldnt hey be btn(1, 1) and so on?
They should be.
Player 2 uses ESDF instead of arrow keys, so make sure you are pressing those?
Since every other game i ever played 2player on user ASWD those were the once i was pressing. Thanks, Springogeek!
For anyone googling 2-player pico-8, this is what i used:
function move2()
plr2.mv=true
if btn(1, 1) then
plr2.x+=plr2.spd
end
if btn(0, 1) then
plr2.x-=plr2.spd
end
if btn(2, 1) then
plr2.y-=plr2.spd
end
if btn(3, 1) then
plr2.y+=plr2.spd
end
if not plr2.mv then
plr2.spr=16
end
if plr2.spr>18 then
plr2.spr=17
end
--This one cycling through 2 sprites for a walking animation
plr2.mv = false
end
where spd is player speed set to in the snippet below. the. The and the player array is:
plr2={}
plr2.x=60
plr2.y=60
plr2.spr=16
plr2.spd=1
plr2.mv=false
and the
[Please log in to post a comment]