- Now Up and Jump can be defined as different keys/buttons.
This commit is contained in:
@@ -87,7 +87,7 @@ function abad_state_normal()
|
|||||||
elseif btn(keyLeft) or pad(btnLeft) then
|
elseif btn(keyLeft) or pad(btnLeft) then
|
||||||
abad.update=abad_state_walking
|
abad.update=abad_state_walking
|
||||||
abad.flip=true
|
abad.flip=true
|
||||||
elseif btn(keyUp) or pad(btnUp) then
|
elseif btn(keyJump) or pad(btnJump) then
|
||||||
abad.update=abad_state_jumping
|
abad.update=abad_state_jumping
|
||||||
abad.step=0
|
abad.step=0
|
||||||
abad.jumpfwd=false
|
abad.jumpfwd=false
|
||||||
@@ -185,7 +185,7 @@ function abad_state_walking()
|
|||||||
|
|
||||||
abad_make_safe()
|
abad_make_safe()
|
||||||
|
|
||||||
if btn(keyUp) or pad(btnUp) then
|
if btn(keyJump) or pad(btnJump) then
|
||||||
abad.update=abad_state_jumping
|
abad.update=abad_state_jumping
|
||||||
abad.step=0
|
abad.step=0
|
||||||
abad.jumpfwd=true
|
abad.jumpfwd=true
|
||||||
|
|||||||
@@ -436,6 +436,14 @@ function update_menu()
|
|||||||
setconf("keyright", keyRight)
|
setconf("keyright", keyRight)
|
||||||
end
|
end
|
||||||
elseif menu_count==4 then
|
elseif menu_count==4 then
|
||||||
|
text("PULSA TECLA PER A BOTAR", 20, 24, 13)
|
||||||
|
local key = btnp();
|
||||||
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
|
menu_count = 5
|
||||||
|
keyJump=key
|
||||||
|
setconf("keyjump", keyJump)
|
||||||
|
end
|
||||||
|
elseif menu_count==5 then
|
||||||
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
|
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 and key~=KEY_ESCAPE then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
@@ -483,6 +491,14 @@ function update_menu()
|
|||||||
setconf("btnright", btnRight)
|
setconf("btnright", btnRight)
|
||||||
end
|
end
|
||||||
elseif menu_count==4 then
|
elseif menu_count==4 then
|
||||||
|
text("PULSA BOTÓ PER A BOTAR", 22, 24, 13)
|
||||||
|
local btn = padp();
|
||||||
|
if btn ~= -1 then
|
||||||
|
menu_count = 5
|
||||||
|
btnJump=btn
|
||||||
|
setconf("btnjump", btnJump)
|
||||||
|
end
|
||||||
|
elseif menu_count==5 then
|
||||||
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
|
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= -1 then
|
if btn ~= -1 then
|
||||||
|
|||||||
@@ -29,12 +29,14 @@ function _init()
|
|||||||
keyDown = tonumber(getconf("keydown")) or KEY_DOWN
|
keyDown = tonumber(getconf("keydown")) or KEY_DOWN
|
||||||
keyLeft = tonumber(getconf("keyleft")) or KEY_LEFT
|
keyLeft = tonumber(getconf("keyleft")) or KEY_LEFT
|
||||||
keyRight = tonumber(getconf("keyright")) or KEY_RIGHT
|
keyRight = tonumber(getconf("keyright")) or KEY_RIGHT
|
||||||
|
keyJump = tonumber(getconf("keyjump")) or KEY_UP
|
||||||
keyShoot = tonumber(getconf("keyshoot")) or KEY_SPACE
|
keyShoot = tonumber(getconf("keyshoot")) or KEY_SPACE
|
||||||
|
|
||||||
btnUp = tonumber(getconf("btnup")) or BTN_UP
|
btnUp = tonumber(getconf("btnup")) or BTN_UP
|
||||||
btnDown = tonumber(getconf("btndown")) or BTN_DOWN
|
btnDown = tonumber(getconf("btndown")) or BTN_DOWN
|
||||||
btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT
|
btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT
|
||||||
btnRight = tonumber(getconf("btnright")) or BTN_RIGHT
|
btnRight = tonumber(getconf("btnright")) or BTN_RIGHT
|
||||||
|
btnJump = tonumber(getconf("btnjump")) or BTN_UP
|
||||||
btnShoot = tonumber(getconf("btnshoot")) or BTN_A
|
btnShoot = tonumber(getconf("btnshoot")) or BTN_A
|
||||||
|
|
||||||
--game_init()
|
--game_init()
|
||||||
|
|||||||
Reference in New Issue
Block a user