sfx in prog

This commit is contained in:
James Turk 2023-03-09 00:27:24 -06:00
parent 9be34a91d6
commit 89f64fe4c4

View File

@ -236,7 +236,7 @@ function sled_upd()
if btnp(4) and t() - mush_time > 1 then
mush_time = t()
sfx(3)
sfx(2)
--steering = rnd({-2, 2})
end
@ -405,28 +405,30 @@ npc = {
dy=0,
last=0,
draw=nil,
collide=nil,
sound=nil,
}
function npc_upd()
-- every 200, roll for new npc
if distance - npc.last > 200 then
local r = rnd()
printh("npc roll: "..r)
if r < 0.03 then
npc.draw = draw_siren
npc.collide = crash
npc.sound = 6
elseif r < 0.1 then
npc.draw = draw_yeti
npc.collide = crash
npc.sound = 3
elseif r < 0.2 then
npc.draw = draw_moose
npc.collide = crash
npc.sound = 4
elseif r < 0.4 then
npc.draw = draw_fan
npc.collide = heart
else
npc.draw = nil
npc.collide = nil
npc.sound = 7
end
npc.last = distance
npc.y = rnd(40)
@ -436,6 +438,7 @@ function npc_upd()
if rnd() < 0.5 then
npc.x += 140
npc.dx *= -1
sound(7)
end
end
@ -445,8 +448,9 @@ function npc_upd()
-- check collision
l, r = sled_bounds()
if npc.y > 50 and npc.x > l and npc.x < r and npc.collide then
if npc.y > 80 and npc.x+8 > l and npc.x < r and npc.collide != nil then
npc.collide()
npc.collide = nil
end
end
@ -680,7 +684,7 @@ __sfx__
001200001d0501f0502203024030270302703027030220302203022030240302703027030240302203024030290302903027030240302203024030290302b030270302403022030290302b0302b0302703022030
301200001340227402274022953227402274022740229532004020000200002295320000200002295322953200002000020000229532000020000200002295320000200002000022953200002000022953229532
000200000000000000000000000000000011500215002150041500515006150081500c1500e150101501315017150191501d1502015021150261502c1502f1500000000000000000000000000000000000000000
0003000000107001070010700107001070a157095570a157085570a157095570a1570b5570c1570d5570f15710557131571155718157145571d157175571f1571355700107001070010700107001070010700107
0003000000107001070010700107001070a157095570a157085570a157095570a1570b5570c1570d5570f15710557131571155718157145571805717557190571355700107001070010700107001070010700107
0004000000600006000060000600186501d65022650276502b6502f6502f6502c6502c6502c6502b6502b6502965027650236501e6501c6500060000600006000060000600006000060000600006000060000600
21060000005001655016550165501b5501b55018550185501d5501d55016550165501b5501b5501655016550225502255024550245501d5501d55027550275501d5501d550275502755018550185501b5501b550
000600000070200702007020f75213752187521c75220752327522375223752207521d7521a7521775214752127523075216752197521c75222752277522a7522c7523475223752207521e752007020070200702