diff --git a/src/i18n/en.lua b/src/i18n/en.lua index cf847a6..f7b1b8c 100644 --- a/src/i18n/en.lua +++ b/src/i18n/en.lua @@ -34,7 +34,8 @@ IT WON'T BE LONG NOW, BEFORE WE GO TO OUR REWARD. TETΓ‰LESTAI ]], phoneRing = "THE PHONE RINGS IMPATIENTLY", - phonePickup = "[%s]: PICK UP", - phoneRedial = "[%s]: *69", + phonePickup = "[%s]: PICK UP", --use key + phoneRedial = "[%s]: *69", --use key phoneClue = "πŸ””πŸ””πŸ””πŸ””πŸ””πŸ””πŸ””", + phoneWin = "WHAT IS WANTED", } \ No newline at end of file diff --git a/src/level/world.lua b/src/level/world.lua index 90284de..d024825 100644 --- a/src/level/world.lua +++ b/src/level/world.lua @@ -92,4 +92,8 @@ function t.pickupPhone() return contempra.pickup() end +function t.ring( idx ) + return bell.ring( idx ) +end + return t \ No newline at end of file diff --git a/src/models/bell.lua b/src/models/bell.lua index 3503598..90e22a3 100644 --- a/src/models/bell.lua +++ b/src/models/bell.lua @@ -71,32 +71,32 @@ local function lgMesh( primitive ) local finalMesh for name, accIdx in pairs( primitive.attributes ) do local acc = asset.accessors[accIdx+1] - + local mesh = love.graphics.newMesh( {attributeFormat(name, acc)}, --vertexformat acc.count, "triangles", "static" ) - + local bfv = bufferViews[1+acc.bufferView] mesh:setVertices( bfv ) - + if finalMesh then finalMesh:attachAttribute( attributeNames[name], mesh ) else finalMesh = mesh end - + end - - + + do local acc = asset.accessors[1+primitive.indices] local bfv = bufferViews[1+acc.bufferView] finalMesh:setVertexMap(bfv, elementComponentTypes[acc.componentType] ) end - + if primitive.material then finalMesh:setTexture( lgTexture( primitive.material ) ) end return finalMesh end @@ -106,14 +106,20 @@ local bellMesh = lgMesh( asset.meshes[1].primitives[1] ) --each bell has the following positional data: -- scale, x, z, colorparam local bells = {} -local bellInstanceMesh +local bellInstanceMesh +local ringSource = love.audio.newSource( "sfx/bellC2.ogg", "static" ) + do 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 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 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 end bellInstanceMesh = lg.newMesh({{"bellInstance","float",4}}, bells, nil, "static" ) @@ -139,11 +145,16 @@ end function t.transpose( i, j ) print( "transposing:", i, j ) io.flush() - bells[i][2], bells[i][3], bells[j][2], bells[j][3] = - bells[j][2], bells[j][3], bells[i][2], bells[i][3] + bells[i][1], bells[j][1] = bells[j][1], bells[i][1] bellInstanceMesh:setVertices( bells ) bellMesh:attachAttribute( "bellInstance", bellInstanceMesh, "perinstance" ) end +function t.ring( i ) + ringSource:stop() + ringSource:setPitch( bells[i][1] ) + ringSource:play() +end + return t \ No newline at end of file diff --git a/src/models/contempra.lua b/src/models/contempra.lua index cb8671a..14fea7b 100644 --- a/src/models/contempra.lua +++ b/src/models/contempra.lua @@ -121,7 +121,7 @@ local shaders = { } 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 function obj.draw( view, proj, light, x, z ) diff --git a/src/scenes/main.lua b/src/scenes/main.lua index 1dc03bf..71a879d 100644 --- a/src/scenes/main.lua +++ b/src/scenes/main.lua @@ -88,6 +88,9 @@ function t.keypressed( key, code, isrepeat ) if code == "1" then return world.transposeBells( 2, 7 ) end + if code == "5" then + return world.ring( 2 ) + end end function t.keyreleased( key, code ) diff --git a/src/sfx/bellC2.ogg b/src/sfx/bellC2.ogg new file mode 100644 index 0000000..48df085 Binary files /dev/null and b/src/sfx/bellC2.ogg differ diff --git a/src/sfx/mus.ogg b/src/sfx/mus.ogg new file mode 100644 index 0000000..3cb7df6 Binary files /dev/null and b/src/sfx/mus.ogg differ