moonbus: fix moving past last level, shorten sounds

This commit is contained in:
Dejvino 2024-08-10 13:00:17 +02:00
parent b03e1c9771
commit 4a30d9f522

View File

@ -25,6 +25,10 @@ function reset()
{map_start=16,map_height=16},
{map_start=16,map_height=15,gravity=0}
}
flag_solid=0
flag_start=1
flag_dock=7
telem_spd={}
@ -268,7 +272,7 @@ function _draw()
end
function get_new_level()
return flr(plr_transed/transed_per_level)+1
return min(flr(plr_transed/transed_per_level)+1,#levels)
end
function check_progress()
@ -290,6 +294,23 @@ function load_level(lvl)
maph=maplevel.map_height
gravity=maplevel.gravity or 0.01
plr_win=false
plr_pos=find_random_point_by_flag(1)
end
function find_random_point_by_flag(f)
local pts={}
for x=0,127 do
for y=0,maph-1 do
local m=mget(x,mapy+y)
local pt=fget(m,f)
if pt then
add(pts,{x=x,y=y})
end
end
end
local di=flr(rnd(#pts))+1
local mp=pts[di]
return {x=mp.x,y=maph-mp.y}
end
function next_target()
@ -371,14 +392,14 @@ function limit(val,lim)
return val
end
__gfx__
000000000000000000000000000000000000aa00000000000000b000000000000000000000000000000000000000000000000000000000000000000000000000
00a9a90000a9a90000a9a90000a9a90000a9000000a9a9000000b000000000000000000000000000000000000000000000000000000000000000000000000000
001111000011110000111100001111000001000000111100008bb800000000000000000000000000000000000000000000000000000000000000000000000000
01111110011111100111111001111110010010100111111000b00bbb000000000000000000000000000000000000000000000000000000000000000000000000
0a9999400a9999400a9999400a9999400a9990400a776540bbb00b00000000000000000000000000000000000000000000000000000000000000000000000000
5a9999458a9999455a9999455a999948000909555a7c5645008bb800000000000000000000000000000000000000000000000000000000000000000000000000
594944458949444559494445594944485949044059671545000b0000000000000000000000000000000000000000000000000000000000000000000000000000
0055550000555500008888000055550050555500007c5600000b0000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000aa000000000050000005000000000000000000000000000000000000000000000000000000000000000000000000
00a9a90000a9a90000a9a90000a9a90000a9000000a9a90000000000000000000000000000000000000000000000000000000000000000000000000000000000
00111100001111000011110000111100000100000011110000000000000000000000000000000000000000000000000000000000000000000000000000000000
01111110011111100111111001111110010010100111111000000000000000000000000000000000000000000000000000000000000000000000000000000000
0a9999400a9999400a9999400a9999400a9990400a77654000000000000000000000000000000000000000000000000000000000000000000000000000000000
5a9999458a9999455a9999455a999948000909555a7c564500000000000000000000000000000000000000000000000000000000000000000000000000000000
59494445894944455949444559494448594904405967154500000000000000000000000000000000000000000000000000000000000000000000000000000000
0055550000555500008888000055550050555500007c560050000005000000000000000000000000000000000000000000000000000000000000000000000000
66566665000000000000000560000000d8ddddbd0000000000566660000000000000000000000000000000000000000000000000000000000000000000000000
666666660000000000000006660000005d7c56d50000000006666666000000000000000000000000000000000000000000000000000000000000000000000000
56666657000000000000005756600000566715570000000006666657000000000000000000000000000000000000000000000000000000000000000000000000
@ -404,14 +425,14 @@ __gfx__
55511166565655500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
11100006555555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__gff__
0000000000000000000000000000000001000000810001000000000000000000000181000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000200000000000000000001000000810001000000000000000000000181000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000011001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000011110000000000000000000000000000000000001210141000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000111100000000000000001210101300000000000000000000000000000000121010101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000110000000000000000000000000000110000
0000111100000000060000001210101300000000000000000000000000000000121010101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000110000000000000000000000000000110000
0012101013000000000000121010101000000000000000000000000000000012101010101013000000000000000000000000000000000000000000000000000011000000000000000000000020212123202123000000000000000000110000121010130000000000000000202122101300000000000000000000000012101300
1210101010130000000012101010101011001100000000110000000000121010101010101010130011000000000012141300000000000000000000000000001110130000000000000000000020212121212123000000000011001210101010101010101300001100000000202121101013000012101300000000001210101013
1010101010101010141010101010101010101010101010101010141010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010141010101010101010101010101010101010101010101010101010101010101010101010101010101010101010212221101010101010
@ -420,13 +441,13 @@ __map__
0000000000002021212121212110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000002021211021101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000001021212121230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000121021102123000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000600000000121021102123000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000111112101010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1010101410101010101010101010101010101010141010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000016000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000121413000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000001100000000000000000000000000000016000000000030223100000000000000000000003022212300000000000000101010000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000001100000000000000000000000600000016000000000030223100000000000000000000003022212300000000000000101010000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000121013000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000241025000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1300000000162500000000001100000020212223000000000000000000000000000000000000302121222300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1013000000000000000000121013000000000000000000000016000000000000000000000000302121213100000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@ -440,11 +461,11 @@ __map__
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
__sfx__
000400002c2501f250132503365036650396503765035650316502f6502c650246501d6501b6501b65019650126500e65010650116500c6500d6500e6500c6500a65007650016500065000000000000000000000
010800000a4500a4500a4503d0502d0503d0502645026050264503d61421630216301d6201c6101a6150000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000400002c2501f250132503365036660396503764035630316202f6202c620246201d6101b6101b61019610126100e61010610116100c6000d6000e6000c6000a60007600016000060000000000000000000000
010800003d0202d0203d0203d61421620216201d6101c6101a6150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0001002005750087500b7500b7500a750067500375005750087500a7500b7500a75009750047500475006750097500a7500a75009750087500675006750087500a7500a75008750067500675008750097500a750
00080000161501915026150241501d150161500e1500c150061500315001150001500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010800003d61421630264502605026450216302162021610216102161600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00020000226502265026150241501d150161500e1500c150061500315001150001500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010800002605000000260502163021610216102161600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000