Log In  
Follow
Zellente

Hi, I try to make a one-button game and thought I could extend it to four players , maybe even using one controller (but yes two players on the direction pad might not work).

On a keyboard 4 players could use the keys from both players, even esdf, for movement. Btnp() returns an integer that represents the pressed button/keys. e.g. 512 for player2,-> (right).

The players use the x ("x" and o ("c") buttons and on keybord q,w. I could use btnp(4,0), btnp(5,0) and btnp(4,1),btnp(5,1) but it would use 4 "if-statements" instead of one and I want to use the keyboard and variable keysetting.

I would like to have something like this:

playerbtn		= {32,16,4096,8192}
player[i]		= {btnpressed = playerbtn[i])

for i=1,game.playernumber do
if btnp() == player[i].btnpressed then
some code
end
end

instead of four times this:

if btnp(5,0) then
if player[1].movment < 8 then

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=156371#p)
1
6 comments



Today I finished some code restruction,from scatch and noticed I forgot to "copy" the sprites and the map and no problem
export foo.png //nice
export foo.map.png //nice
and easy
import foo.png //nice

and
import foo.map.png //ups just spritesheet is full
? okay
import map foo.map.png //nope

Of Course I can just copy the code to the cart with the map I want, but is there a command I didn't found? There are parameter import foobar.png -L, that do not help me.
The Pico-8 manual has only export map...

3 comments