moonbus: fix getting next target after reaching target dock

This commit is contained in:
Dejvino 2024-08-10 16:17:20 +02:00
parent 62b85fa0f2
commit eb8d8a722e

View File

@ -52,10 +52,10 @@ function load_level()
gravity=maplevel.gravity or 0.01 gravity=maplevel.gravity or 0.01
engine_power=0.1 engine_power=0.1
fuel_cons=0.005 fuel_cons=0.01
land_speed_limit=1 land_speed_limit=1
bonus_docked=1 bonus_docked=1
transed_per_level=1 transed_per_level=5
plr_pos=find_random_point_by_flag(1) plr_pos=find_random_point_by_flag(1)
telem_spd={} telem_spd={}
@ -90,15 +90,16 @@ function _update()
if btn(➡️) then plr_engine=➡️ end if btn(➡️) then plr_engine=➡️ end
end end
if plr_docked and btn(❎) then if plr_docked and btn(❎) then
if plr_win then plr_docked=false
make_progress() plr_static=false
else plr_engine=⬆️
plr_docked=false plr_speed={x=0,y=0.5}
plr_static=false if not plr_win then
plr_engine=⬆️
plr_speed={x=0,y=0.5}
sfx(4) sfx(4)
else
--
end end
make_progress()
end end
end end
@ -305,8 +306,9 @@ function make_progress()
if (plr_win) then if (plr_win) then
plr_level=get_new_level() plr_level=get_new_level()
load_level() load_level()
else
next_target()
end end
next_target()
end end
function find_random_point_by_flag(f) function find_random_point_by_flag(f)