- Icon resource for Windows added
- Zoom and fullscreen controlled from Lua - Basic gamepad support
This commit is contained in:
@@ -81,13 +81,13 @@ function abad_state_normal()
|
||||
end
|
||||
abad_make_safe()
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=false
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=true
|
||||
elseif btn(KEY_UP) then
|
||||
elseif btn(keyUp) or pad(btnUp) then
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
@@ -96,11 +96,11 @@ function abad_state_normal()
|
||||
abad.jump=nil
|
||||
end
|
||||
playsnd(audio_abad_jump)
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btn(KEY_Z) then
|
||||
abad.respawning=240
|
||||
elseif btnp(KEY_SPACE) and cacau.hab==-1 then
|
||||
--elseif btn(KEY_Z) then
|
||||
-- abad.respawning=240
|
||||
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then
|
||||
playsnd(audio_abad_shot)
|
||||
abad.update=abad_state_fire
|
||||
abad.wait=0
|
||||
@@ -116,7 +116,7 @@ function abad_state_crouch()
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
|
||||
if not btn(KEY_DOWN) then
|
||||
if not (btn(keyDown) or pad(btnDown)) then
|
||||
abad.update=abad_state_normal
|
||||
abad.bb.y=0
|
||||
abad.bb.h=16
|
||||
@@ -185,7 +185,7 @@ function abad_state_walking()
|
||||
|
||||
abad_make_safe()
|
||||
|
||||
if btn(KEY_UP) then
|
||||
if btn(keyUp) or pad(btnUp) then
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=true
|
||||
@@ -195,18 +195,18 @@ function abad_state_walking()
|
||||
end
|
||||
playsnd(audio_abad_jump)
|
||||
return
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btn(KEY_SPACE) and cacau.hab==-1 then
|
||||
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then
|
||||
playsnd(audio_abad_shot)
|
||||
abad.update=abad_state_fire
|
||||
abad.wait=0
|
||||
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
|
||||
end
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.flip=false
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.flip=true
|
||||
elseif abad.wait==0 then
|
||||
abad.update=abad_state_normal
|
||||
@@ -297,15 +297,15 @@ function abad_state_stairs()
|
||||
if abad.wait==6 then
|
||||
abad.wait=0
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.flip=false
|
||||
abad_advance()
|
||||
playsnd(audio_low)
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.flip=true
|
||||
abad_advance()
|
||||
playsnd(audio_low)
|
||||
elseif btn(KEY_UP) then
|
||||
elseif btn(keyUp) or pad(btnUp) then
|
||||
if abad.y>0 then
|
||||
if check_tile(abad.hab,abad.x+4,abad.y+8)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+8)==tiletype.stair then
|
||||
abad.y=abad.y-2
|
||||
@@ -316,7 +316,7 @@ function abad_state_stairs()
|
||||
imp.reset()
|
||||
abad.y=32
|
||||
end
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) then
|
||||
if abad.y<32 then
|
||||
if check_tile(abad.hab,abad.x+4,abad.y+16)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+16)==tiletype.stair then
|
||||
abad.y=abad.y+2
|
||||
|
||||
Reference in New Issue
Block a user