- Ara es pot usar el gamepad per a tot
This commit is contained in:
@@ -311,7 +311,7 @@ function update_game()
|
||||
--elseif btnp(KEY_ESCAPE) then
|
||||
-- pause()
|
||||
--end
|
||||
if btnp(KEY_ESCAPE) then
|
||||
if btnp(KEY_ESCAPE) or padp(btnPause) then
|
||||
pause()
|
||||
end
|
||||
if abad.objects.gps~=nil then
|
||||
@@ -326,6 +326,17 @@ function update_game()
|
||||
elseif btnp(KEY_5) then
|
||||
current_camera=5
|
||||
end
|
||||
if padp(btnCycle1) then
|
||||
current_camera=current_camera+1
|
||||
if current_camera==6 then current_camera=1 end
|
||||
if current_camera==1 and (abad.objects.gorro or abad.objects.clau_premiere) then current_camera=2 end
|
||||
if current_camera==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=3 end
|
||||
elseif padp(btnCycle2) then
|
||||
current_camera=current_camera-1
|
||||
if current_camera==0 then current_camera=5 end
|
||||
if current_camera==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=1 end
|
||||
if current_camera==1 and (abad.objects.gorro or abad.objects.clau_premiere) then current_camera=5 end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -395,7 +406,7 @@ function update_menu()
|
||||
else
|
||||
playmus(audio_main_song)
|
||||
end
|
||||
elseif btnp(KEY_ESCAPE) then
|
||||
elseif btnp(KEY_ESCAPE) or padp(btnPause) then
|
||||
quit()
|
||||
end
|
||||
elseif menu_state==1 then
|
||||
@@ -528,6 +539,7 @@ function pause()
|
||||
sspr(0,0,128,96,0,0)
|
||||
setdest(0)
|
||||
setsource(tiles)
|
||||
pausa_option=1
|
||||
pause_old_update=game_update
|
||||
game_update=update_pause
|
||||
end
|
||||
@@ -536,16 +548,30 @@ function update_pause()
|
||||
rectfill(16,16,112,80,16)
|
||||
rect(16,16,112,80,15)
|
||||
prnt("PAUSA",54,30,15)
|
||||
prnt("ESC torna al joc",30,50,14)
|
||||
prnt("SPACE eixir",30,60,14)
|
||||
if pausa_option==1 then
|
||||
rect(28,48,100,56,13)
|
||||
else
|
||||
rect(28,58,100,66,13)
|
||||
end
|
||||
prnt("CONTINUAR",30,50,14)
|
||||
prnt("EIXIR",30,60,14)
|
||||
|
||||
if btnp(KEY_ESCAPE) then
|
||||
setsource(back)
|
||||
sspr(0,0,128,96,0,0)
|
||||
setsource(tiles)
|
||||
game_update = pause_old_update
|
||||
elseif btnp(keyDown) or btnp(keyUp) or padp(btnDown) or padp(btnUp) then
|
||||
if pausa_option==1 then pausa_option=2 else pausa_option=1 end
|
||||
elseif btnp(keyShoot) or padp(btnShoot) then
|
||||
game_exit()
|
||||
game_init(true)
|
||||
if pausa_option==1 then
|
||||
setsource(back)
|
||||
sspr(0,0,128,96,0,0)
|
||||
setsource(tiles)
|
||||
game_update = pause_old_update
|
||||
else
|
||||
game_exit()
|
||||
game_init(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user