This commit is contained in:
wan-may 2025-03-20 22:29:00 -03:00
parent 5a5a31430c
commit 1ddffb71e4
7 changed files with 34 additions and 15 deletions

View File

@ -34,7 +34,8 @@ IT WON'T BE LONG NOW, BEFORE WE GO TO OUR REWARD.
TETÉLESTAI TETÉLESTAI
]], ]],
phoneRing = "THE PHONE RINGS IMPATIENTLY", phoneRing = "THE PHONE RINGS IMPATIENTLY",
phonePickup = "[%s]: PICK UP", phonePickup = "[%s]: PICK UP", --use key
phoneRedial = "[%s]: *69", phoneRedial = "[%s]: *69", --use key
phoneClue = "🔔🔔🔔🔔🔔🔔🔔", phoneClue = "🔔🔔🔔🔔🔔🔔🔔",
phoneWin = "WHAT IS WANTED",
} }

View File

@ -92,4 +92,8 @@ function t.pickupPhone()
return contempra.pickup() return contempra.pickup()
end end
function t.ring( idx )
return bell.ring( idx )
end
return t return t

View File

@ -107,13 +107,19 @@ local bellMesh = lgMesh( asset.meshes[1].primitives[1] )
-- scale, x, z, colorparam -- scale, x, z, colorparam
local bells = {} local bells = {}
local bellInstanceMesh local bellInstanceMesh
local ringSource = love.audio.newSource( "sfx/bellC2.ogg", "static" )
do do
local c, s = math.cos( 2*math.pi / 7 ), -math.sin( 2*math.pi / 7 ) local c, s = math.cos( 2*math.pi / 7 ), -math.sin( 2*math.pi / 7 )
local x, z = math.cos(math.pi/7), -math.sin( math.pi/7 ) local x, z = math.cos(math.pi/7), -math.sin( math.pi/7 )
local pitches = { 0, 5, 8, 12, 10, 22, 25 }
for i = 1, #pitches do
pitches[i] = math.pow( 2.0, pitches[i] / 12.0 )
end
local r = 20 local r = 20
for i = 1, 7 do for i = 1, 7 do
bells[i] = { i / 2, r * x, r * z, (i-1)/6 } bells[i] = { 5.0 / pitches[i], r * x, r * z, (i-1)/6 }
x, z = c*x+s*z, c*z-s*x x, z = c*x+s*z, c*z-s*x
end end
bellInstanceMesh = lg.newMesh({{"bellInstance","float",4}}, bells, nil, "static" ) bellInstanceMesh = lg.newMesh({{"bellInstance","float",4}}, bells, nil, "static" )
@ -139,11 +145,16 @@ end
function t.transpose( i, j ) function t.transpose( i, j )
print( "transposing:", i, j ) print( "transposing:", i, j )
io.flush() io.flush()
bells[i][2], bells[i][3], bells[j][2], bells[j][3] = bells[i][1], bells[j][1] = bells[j][1], bells[i][1]
bells[j][2], bells[j][3], bells[i][2], bells[i][3]
bellInstanceMesh:setVertices( bells ) bellInstanceMesh:setVertices( bells )
bellMesh:attachAttribute( "bellInstance", bellInstanceMesh, bellMesh:attachAttribute( "bellInstance", bellInstanceMesh,
"perinstance" ) "perinstance" )
end end
function t.ring( i )
ringSource:stop()
ringSource:setPitch( bells[i][1] )
ringSource:play()
end
return t return t

View File

@ -121,7 +121,7 @@ local shaders = {
} }
local function veilAlpha( x, z ) local function veilAlpha( x, z )
return math.max( 0, math.min( 1.0, 1.0 - (x*x+z*z - 7.0) / 25.0)) return math.max( 0, math.min( 1.0, 1.0 - (x*x+z*z - 3.0) / 90.0))
end end
function obj.draw( view, proj, light, x, z ) function obj.draw( view, proj, light, x, z )

View File

@ -88,6 +88,9 @@ function t.keypressed( key, code, isrepeat )
if code == "1" then if code == "1" then
return world.transposeBells( 2, 7 ) return world.transposeBells( 2, 7 )
end end
if code == "5" then
return world.ring( 2 )
end
end end
function t.keyreleased( key, code ) function t.keyreleased( key, code )

BIN
src/sfx/bellC2.ogg Normal file

Binary file not shown.

BIN
src/sfx/mus.ogg Normal file

Binary file not shown.