moonbus: stabilizers enabled by O

This commit is contained in:
Dejvino 2024-08-10 11:48:21 +02:00
parent c5c565832d
commit b03e1c9771

View File

@ -53,6 +53,13 @@ function _update()
plr_engine=-1 plr_engine=-1
if plr_alive and plr_fuel>0 then if plr_alive and plr_fuel>0 then
if not plr_docked then if not plr_docked then
if btn(🅾️) and dist(plr_speed)>0.01 then
if abs(plr_speed.x) > abs(plr_speed.y) then
plr_engine=(plr_speed.x>0) and ⬅️ or ➡️
else
plr_engine=(plr_speed.y<0) and ⬆️ or ⬇️
end
end
if btn(⬆️) then plr_engine=⬆️ end if btn(⬆️) then plr_engine=⬆️ end
if btn(⬇️) then plr_engine=⬇️ end if btn(⬇️) then plr_engine=⬇️ end
if btn(⬅️) then plr_engine=⬅️ end if btn(⬅️) then plr_engine=⬅️ end
@ -105,7 +112,7 @@ function _update()
-- crash detection -- crash detection
local pc=plus(plr_pos,{x=0.5,y=-0.5}) local pc=plus(plr_pos,{x=0.5,y=-0.5})
local crashed=false local crashed=false
if plr_pos.y<=0 or plr_pos.y>17 then if plr_alive and (plr_pos.y<=0 or plr_pos.y>17) then
crashed=true crashed=true
elseif pc.y <= maph+1 and not plr_static then elseif pc.y <= maph+1 and not plr_static then
for p in all({plus(pc,clearx(unit(plr_speed,0.4))), plus(pc,cleary(unit(plr_speed,0.4)))}) do for p in all({plus(pc,clearx(unit(plr_speed,0.4))), plus(pc,cleary(unit(plr_speed,0.4)))}) do