Altered particles, added English translation, tweaked physics again.

This commit is contained in:
yaw-man 2023-01-15 18:29:21 -04:00
parent acffdea826
commit ae75751f32
7 changed files with 108 additions and 39 deletions

View File

@ -118,8 +118,8 @@ end
local function Update( score, level )
if level > 2 then
drones.bass:setVolume( 0.5 * math.sqrt( score ) )
drones.alto:setVolume( 0.3 * score )
drones.bass:setVolume( 0.5 * math.sqrt( score ) * (level / 120) )
drones.alto:setVolume( 0.3 * score * ( level / 120 ))
end
end

View File

@ -61,7 +61,7 @@ OnImpact = function( impact )
pass = true
state.currentBeat = state.currentBeat + 1
if state.currentBeat >= 120 then
if state.currentBeat >= 119 then
return OnVictory()
end
@ -186,13 +186,14 @@ OnVictory = function()
love.draw = function()
love.graphics.setColor( 1, 1, 1, 1 )
text.Draw( 120 )
love.graphics.printf(
text.Draw( 119 )
love.graphics.printf(
"your.time:\n"..totalTime,
0, 0.5 * love.graphics.getHeight(),
love.graphics.getWidth(),
"center"
)
)
marble.Draw()
end
@ -212,6 +213,7 @@ Draw = function()
wave.Draw( score )
love.graphics.setColor( 1.0, 1.0, 1.0, 1.0 )
love.graphics.draw(particles, 0, 0)
@ -243,12 +245,11 @@ Draw = function()
sitelenpona.Draw( text.words[state.currentBeat] )
marble.Draw()
text.Draw( state.currentBeat )
end
function love.update( dt )
audio.Update( ExtrapolateBeatScore(), state.currentBeat )

View File

@ -5,8 +5,8 @@ local oldBuffer = love.graphics.newCanvas()
local newBuffer = love.graphics.newCanvas()
local oldState, curState, newState
local FRICTION = 0.05
local MAXSPEED = 4
local INERTIA= 0.03
local MAXSPEED = 3
local ddx, ddy = 0.0, 0.0
local function State( )
@ -22,8 +22,12 @@ function marble.GetAcceleration( ) return ddx, ddy end
function marble.Integrate( step )
newState.t = love.timer.getTime()
newState.dx = (1.0 - FRICTION) * curState.dx + FRICTION * ddx
newState.dy = (1.0 - FRICTION) * curState.dy + FRICTION * ddy
newState.dx = (1.0 - INERTIA
) * curState.dx + INERTIA
* ddx
newState.dy = (1.0 - INERTIA
) * curState.dy + INERTIA
* ddy
newState.x = curState.x + newState.dx * step * MAXSPEED
newState.y = curState.y + newState.dy * step * MAXSPEED
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -4,26 +4,29 @@ local feet = {}
local feetNL = {}
local words = {} --Sequence of tables.
local poem = {[0] = ""}
local poemLang = { [0] = "" }
local poemLines = {[0] = 0}
local mt = { __index = function() return "linja" end }
local s = love.filesystem.read( "text/tok.txt" )
local smallFont = love.graphics.setNewFont( "text/linja-sike.ttf", 12 )
local largeFont = love.graphics.setNewFont( "text/linja-sike.ttf", 32 )
local enFont = love.graphics.setNewFont( "text/linja-sike.ttf", 18 )
local smallFont = love.graphics.setNewFont( "text/linja-sike.ttf", 24 )
local largeFont = love.graphics.setNewFont( "text/linja-sike.ttf", 64 )
local i = 1
--Split string into feet.
for foot in s:gmatch( ".-%-") do
feet[i] = foot:gsub( "-", "" ):gsub( " $", "" ):gsub( "%c", "") --Remove hyphens, trailing spaces, newlines.
feetNL[i] = foot:gsub( "-", "" ):gsub(" ", "")--:gsub( "%.", " " ) --Remove hyphens, spaces, transform periods to spaces
poem[i] = poem[ i - 1 ]..feetNL[i]
poemLines[i] = poemLines[i - 1] + (feetNL[i]:match( "\n") and 1 or 0)
i = i + 1
end
@ -52,21 +55,62 @@ end
local function Draw( beat )
local foot = feet[ beat ]
love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
love.graphics.printf(
foot,
0, (9/10) * love.graphics.getHeight(),
if beat == 1 then
love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
love.graphics.printf( "wasd.space",
0, 0.5 * love.graphics.getHeight(),
love.graphics.getWidth(),
"center")
"center"
)
return
end
love.graphics.setColor(1.0, 1.0, 1.0, 0.5)
love.graphics.print( poem[beat], 0, (3 - poemLines[beat]) * 32 )
local lineNumber
if poemLines[beat] < 2 then lineNumber = 0
else lineNumber = 2 - poemLines[beat]
end
love.graphics.printf( poem[beat],
smallFont,
8, lineNumber * smallFont:getHeight(),
love.graphics.getWidth(),
"left"
)
love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
love.graphics.printf( foot,
largeFont,
0, 0.87 * love.graphics.getHeight(),
love.graphics.getWidth(),
"center"
)
love.graphics.setColor(1.0, 1.0, 1.0, 0.5)
love.graphics.printf( poemLang[beat],
enFont,
-8, 0,--(2 - poemLines[beat]) * smallFont:getHeight(),
love.graphics.getWidth(),
"right"
)
end
s = love.filesystem.read( "text/en.txt" )
i = 1
--Split string into lines.
for line in s:gmatch( ".-\n") do
line = line:gsub("%.", ","):gsub( " ", "." )
poemLang[i] = line
poemLang[i + 1], poemLang[i + 2], poemLang[i + 3] = poemLang[i], poemLang[i], poemLang[i]
i = i + 4
end
local Reset = function() end
return { feet = feet, words = words, feetNL = feetNL, Reset = Reset, Draw = Draw }

View File

@ -1,10 +1,30 @@
CUT
MY
LIFE
INTO
PIECES
THIS
IS
MY
LAST
RESORT
first, i was a person of no speech
and could only cry
and could not share my feelings verbally
communication in crying is quite powerful
weirdly, people seem to
be able to stay good to me
they keep helping me
my food comes from good people
my parents are great
i have two of them. they should
only be concerned with me. many needs
are in my complicated body
often i feel weird!
i want to play a lot
my wish is this: this sand
should become a sturdy house
this strong house should have a room
in there - a me-person is in charge
assertively, this person says:
"my home is great!
ruin shall come not
disappearance shall not be a possibility"
but, opposite of my wishes, this
happened: someone ruined
my big nice house!
this is sad
what baseless cruelty drove them?
i can't understand
i don't want to talk to them
i go to my reliable parents

View File

@ -150,9 +150,9 @@ end
--Apply bandlimited impulse to wave, adjust free parameters according to game state.
local function OnImpact( impact, level )
IMPULSESIZE = 10.0 * math.sqrt( level / 120.0 )
SOUNDSPEED = 50.0 - 35 * level / 120
DAMPING = 0.03 * ( 1.0 - 0.4 * level / 120 )
IMPULSESIZE = 1.0 + 9.0 * math.sqrt( level / 120.0 )
SOUNDSPEED = 25 - 10 * level / 120
DAMPING = 0.02 * ( 1.0 - 0.4 * level / 120 )
--Apply bandlimited impulse.