moonbus: reset after crash

This commit is contained in:
Dejvino 2024-08-09 20:23:58 +02:00
parent d6df107843
commit 762a895665

View File

@ -4,6 +4,7 @@ __lua__
-- MoonBus
-- by Dejvino
function reset()
plr_alive=true
plr_win=false
plr_docked=false
@ -21,9 +22,17 @@ fuel_cons=0.01
land_speed_limit=1
maph=8
cam={}
end
function _init()
reset()
end
function _update()
debug_points={}
if not plr_alive and btn(❎) then
reset()
end
-- controlls
plr_engine=-1
@ -90,6 +99,7 @@ function _update()
break
elseif solid or plr_pos.y<=0 then
plr_speed.y*=-0.75
plr_speed.x*=0.5
plr_alive=false
if (dist(plr_speed) > 1) then
sfx(0)
@ -168,12 +178,14 @@ function _draw()
if plr_alive then
if plr_docked then
print("smooth! you docked.", 0,0,3)
print("press ❎ to undock.", 32,60,11)
else
print("land gently to dock.", 0,0,3)
end
else
print("oops! you crashed.", 0,0,8)
print("press ❎ to reset.", 32,60,11)
end
end