Log In  

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.

P#27388 2016-08-26 11:42 ( Edited 2016-08-26 17:22)

try btn(0, 1) to get the 0th button for the second player.

P#27389 2016-08-26 12:00 ( Edited 2016-08-26 16:00)

Cool! I cant get the other buttons to work. SHouldnt hey be btn(1, 1) and so on?

P#27392 2016-08-26 12:25 ( Edited 2016-08-26 16:25)

They should be.

Player 2 uses ESDF instead of arrow keys, so make sure you are pressing those?

P#27393 2016-08-26 12:29 ( Edited 2016-08-26 16:29)

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

P#27397 2016-08-26 13:22 ( Edited 2016-08-26 17:22)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 12:25:07 | 0.006s | Q:11