Initial theming support
This commit is contained in:
parent
540fb35a4d
commit
32860b9138
161
main.lua
161
main.lua
|
@ -16,6 +16,50 @@ menuSelect = 1
|
|||
menuScroll = 0
|
||||
quitted = false
|
||||
|
||||
-- Themes
|
||||
themes = {
|
||||
default = {
|
||||
name = "Default",
|
||||
red = { 0.9, 0, 0 },
|
||||
lightRed = { 1, 0.5, 0.5 },
|
||||
darkRed = { 0.5, 0, 0 },
|
||||
blue = { 0, 0, 0.9 },
|
||||
lightBlue = { 0.5, 0.5, 1 },
|
||||
darkBlue = { 0, 0, 0.5 },
|
||||
purple = { 1, 0, 1 },
|
||||
black = { 0, 0, 0 },
|
||||
gray = { 0.5, 0.5, 0.5 },
|
||||
white = { 1, 1, 1 }
|
||||
},
|
||||
light = {
|
||||
name = "Light",
|
||||
red = { 0.9, 0, 0 },
|
||||
lightRed = { 1, 0.5, 0.5 },
|
||||
darkRed = { 0.5, 0, 0 },
|
||||
blue = { 0, 0, 0.9 },
|
||||
lightBlue = { 0.5, 0.5, 1 },
|
||||
darkBlue = { 0, 0, 0.5 },
|
||||
purple = { 1, 0, 1 },
|
||||
black = { 1, 1, 1 },
|
||||
gray = { 0.5, 0.5, 0.5 },
|
||||
white = { 0, 0, 0 },
|
||||
},
|
||||
gruvbox = {
|
||||
name = "Gruvbox",
|
||||
red = { 0.8, 0.1412, 0.1137 },
|
||||
lightRed = { 0.9843, 0.2863, 0.2039 },
|
||||
darkRed = { 0.6157, 0, 0.023529 },
|
||||
blue = { 0.2706, 0.5216, 0.5333 },
|
||||
lightBlue = { 0.5137, 0.6471, 0.5961 },
|
||||
darkBlue = { 0.027451, 0.4, 0.4706 },
|
||||
purple = { 0.6941, 0.3843, 0.5255 },
|
||||
black = { 0.1569, 0.1569, 0.1569 },
|
||||
gray = { 0.6588, 0.6, 0.5176 },
|
||||
white = { 0.9216, 0.8588, 0.698 }
|
||||
}
|
||||
}
|
||||
currentTheme = themes.default
|
||||
|
||||
-- Player coordinates and scores
|
||||
player1 = {
|
||||
x = playerDistance + 20,
|
||||
|
@ -97,7 +141,7 @@ ball = {
|
|||
img = nil,
|
||||
counter = 0,
|
||||
startCounter = 0,
|
||||
color = { 1, 1, 1 }
|
||||
color = { currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] }
|
||||
}
|
||||
|
||||
-- Function to redefine keys w/ user input
|
||||
|
@ -199,7 +243,7 @@ function reset()
|
|||
player1.counter = 0
|
||||
player1.xVelocity = nil
|
||||
player1.yVelocity = nil
|
||||
|
||||
|
||||
-- Reset player 2
|
||||
player2.x = love.graphics.getWidth() - ( 120 + playerDistance )
|
||||
player2.y = playerDistance + 20
|
||||
|
@ -220,7 +264,7 @@ function reset()
|
|||
end
|
||||
ball.direction = direction
|
||||
ball.startCounter = 0
|
||||
ball.color = { 1, 1, 1 }
|
||||
ball.color = { currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] }
|
||||
|
||||
local blockNum = 0
|
||||
for _, i in ipairs( leftBlocks ) do
|
||||
|
@ -311,7 +355,7 @@ function restart()
|
|||
img = nil,
|
||||
counter = 0,
|
||||
startCounter = 0,
|
||||
color = { 1, 1, 1 }
|
||||
color = { currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] }
|
||||
}
|
||||
|
||||
-- Graphics
|
||||
|
@ -369,7 +413,7 @@ function love.load()
|
|||
player1Settings = binser.deserialize( settings )[2]
|
||||
player2Settings = binser.deserialize( settings )[3]
|
||||
end
|
||||
|
||||
|
||||
-- Create menus
|
||||
-- Main menu
|
||||
newMenu( { name = "main", title = "Breakout Pong", items = {
|
||||
|
@ -531,12 +575,12 @@ function love.load()
|
|||
}, drawCode = function()
|
||||
drawCorners()
|
||||
if winner == "red" then
|
||||
love.graphics.setColor( 0.5, 0, 0 )
|
||||
love.graphics.setColor( currentTheme.darkRed )
|
||||
else
|
||||
love.graphics.setColor( 0, 0, 0.5 )
|
||||
love.graphics.setColor( currentTheme.darkBlue )
|
||||
end
|
||||
love.graphics.rectangle( "fill", 0, playAreaHeight, love.graphics.getWidth(), 50 )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
local menuFont = love.graphics.newFont( 40 )
|
||||
love.graphics.setFont( menuFont )
|
||||
love.graphics.printf( "Winner: " .. winner, 10, playAreaHeight, love.graphics.getWidth() - 20, "center" )
|
||||
|
@ -644,7 +688,7 @@ function love.update( dt )
|
|||
keyCounter = 0
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if not player1Settings.ai then
|
||||
-- Left and right movement for player 1
|
||||
if getKeyDown( "player1", "left" ) then
|
||||
|
@ -1096,7 +1140,7 @@ function love.update( dt )
|
|||
else
|
||||
ball.y = 0
|
||||
end
|
||||
ball.color = { 1, 0, 1 }
|
||||
ball.color = { currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] }
|
||||
elseif ball.x > love.graphics.getWidth() - 20 or ball.x < 0 then
|
||||
ball.direction = 180 - ball.direction
|
||||
-- Right edge
|
||||
|
@ -1108,7 +1152,7 @@ function love.update( dt )
|
|||
screen:setShake( 40 )
|
||||
reset()
|
||||
else
|
||||
ball.color = { 1, 0, 1 }
|
||||
ball.color = { currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] }
|
||||
ball.x = love.graphics.getWidth() - 20
|
||||
end
|
||||
else -- Left edge
|
||||
|
@ -1119,7 +1163,7 @@ function love.update( dt )
|
|||
screen:setShake( 40 )
|
||||
reset()
|
||||
else
|
||||
ball.color = { 1, 0, 1 }
|
||||
ball.color = { currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] }
|
||||
ball.x = 0
|
||||
end
|
||||
end
|
||||
|
@ -1134,7 +1178,7 @@ function love.update( dt )
|
|||
screen:setShake( 40 )
|
||||
reset()
|
||||
else
|
||||
ball.color = { 1, 0, 1 }
|
||||
ball.color = { currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] }
|
||||
ball.y = playAreaHeight - 20
|
||||
end
|
||||
else -- Top edge
|
||||
|
@ -1145,7 +1189,7 @@ function love.update( dt )
|
|||
screen:setShake( 40 )
|
||||
reset()
|
||||
else
|
||||
ball.color = { 1, 0, 1 }
|
||||
ball.color = { currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] }
|
||||
ball.y = 0
|
||||
end
|
||||
end
|
||||
|
@ -1154,7 +1198,7 @@ function love.update( dt )
|
|||
if ball.x > ( player1.x - 20 ) and ball.x < ( player1.x + 100 ) and
|
||||
ball.y > playAreaHeight - ( 40 + playerDistance ) and
|
||||
ball.y < playAreaHeight - playerDistance then
|
||||
ball.color = { 1, 0.4, 0.4 }
|
||||
ball.color = { currentTheme.lightRed[1], currentTheme.lightRed[2] - 0.05, currentTheme.lightRed[3] - 0.05 }
|
||||
if ball.x < ( player1.x - 15 ) or ball.x > ( player1.x + 95 ) then
|
||||
ball.direction = 180 - ball.direction
|
||||
if ball.x < ( player1.x - 15 ) then
|
||||
|
@ -1175,7 +1219,7 @@ function love.update( dt )
|
|||
-- Check collision with player 1's y paddle
|
||||
if ball.y > ( player1.y - 20 ) and ball.y < ( player1.y + 100 ) and
|
||||
ball.x > playerDistance - 20 and ball.x < playerDistance + 20 then
|
||||
ball.color = { 1, 0.6, 0.6 }
|
||||
ball.color = { currentTheme.lightRed[1], currentTheme.lightRed[2] + 0.05, currentTheme.lightRed[3] + 0.05 }
|
||||
if ball.y < ( player1.y - 15 ) or ball.y > ( player1.y + 95 ) then
|
||||
ball.direction = 360 - ball.direction
|
||||
if ball.y < ( player1.y - 15 ) then
|
||||
|
@ -1196,7 +1240,7 @@ function love.update( dt )
|
|||
-- Check collision with player 2's x paddle
|
||||
if ball.x > ( player2.x - 20 ) and ball.x < ( player2.x + 100 ) and
|
||||
ball.y > playerDistance - 20 and ball.y < playerDistance + 20 then
|
||||
ball.color = { 0.6, 0.6, 1 }
|
||||
ball.color = { currentTheme.lightBlue[1] + 0.05, currentTheme.lightBlue[2] + 0.05, currentTheme.lightBlue[3] }
|
||||
if ball.x < ( player2.x - 15 ) or ball.x > ( player2.x + 95 ) then
|
||||
ball.direction = 180 - ball.direction
|
||||
if ball.x < ( player2.x - 15 ) then
|
||||
|
@ -1218,7 +1262,7 @@ function love.update( dt )
|
|||
if ball.y > ( player2.y - 20 ) and ball.y < ( player2.y + 100 ) and
|
||||
ball.x > love.graphics.getWidth() - ( 40 + playerDistance ) and
|
||||
ball.x < love.graphics.getWidth() - playerDistance then
|
||||
ball.color = { 0.4, 0.4, 1 }
|
||||
ball.color = { currentTheme.lightBlue[1] - 0.05, currentTheme.lightBlue[2] - 0.05, currentTheme.lightBlue[3] }
|
||||
if ball.y < ( player2.y - 15 ) or ball.y > ( player2.y + 95 ) then
|
||||
ball.direction = 360 - ball.direction
|
||||
if ball.y < ( player2.y - 15 ) then
|
||||
|
@ -1275,10 +1319,14 @@ function love.update( dt )
|
|||
end
|
||||
|
||||
function love.draw( dt )
|
||||
-- Draw background
|
||||
love.graphics.setColor( currentTheme.black )
|
||||
love.graphics.rectangle( "fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight() )
|
||||
|
||||
-- Draw quit screen if exited and in lovejs
|
||||
if quitted then
|
||||
drawMenuBackground()
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
love.graphics.setFont( merriweatherTitle )
|
||||
love.graphics.printf( "Thanks for playing!", 10, 240, love.graphics.getWidth() - 20, "center" )
|
||||
return
|
||||
|
@ -1289,15 +1337,16 @@ function love.draw( dt )
|
|||
menuList[currentMenu].drawCode()
|
||||
|
||||
love.graphics.setFont( merriweatherTitle )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
love.graphics.printf( menuList[currentMenu].title, 10, 160, love.graphics.getWidth() - 20, "center" )
|
||||
for i, menuItem in ipairs(menuList[currentMenu]) do
|
||||
if i > menuScroll and i < 5 + menuScroll then
|
||||
if menuSelect == i then
|
||||
love.graphics.setFont( merriweatherSelected )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
else
|
||||
love.graphics.setFont( merriweatherUnselected )
|
||||
love.graphics.setColor( 0.5, 0.5, 0.5 )
|
||||
love.graphics.setColor( currentTheme.gray )
|
||||
end
|
||||
local itemText = menuItem[1]
|
||||
for j, f in ipairs( menuItem ) do
|
||||
|
@ -1309,7 +1358,7 @@ function love.draw( dt )
|
|||
love.graphics.printf( "> " .. itemText, 10, 160 + ( i * 80 ) - ( menuScroll * 80 ), love.graphics.getWidth() - 20, "center" )
|
||||
elseif i == menuScroll then
|
||||
love.graphics.setFont( merriweatherSmall )
|
||||
love.graphics.setColor( 0.5, 0.5, 0.5 )
|
||||
love.graphics.setColor( currentTheme.gray )
|
||||
local itemText = menuItem[1]
|
||||
for j, f in ipairs( menuItem ) do
|
||||
if j > 2 then
|
||||
|
@ -1320,7 +1369,7 @@ function love.draw( dt )
|
|||
love.graphics.printf( ". . .", 10, 200, love.graphics.getWidth() - 20, "center" )
|
||||
elseif i == 5 + menuScroll then
|
||||
love.graphics.setFont( merriweatherSmall )
|
||||
love.graphics.setColor( 0.5, 0.5, 0.5 )
|
||||
love.graphics.setColor( currentTheme.gray )
|
||||
local itemText = menuItem[1]
|
||||
for j, f in ipairs( menuItem ) do
|
||||
if j > 2 then
|
||||
|
@ -1346,14 +1395,14 @@ function love.draw( dt )
|
|||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 )
|
||||
love.graphics.rectangle( "fill", 0 - ( leftBlocksTransparency[i] * 15 ), ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
love.graphics.setColor( 0, 0, 0, 1 )
|
||||
love.graphics.setColor( currentTheme.black )
|
||||
love.graphics.rectangle( "line", 0 - ( leftBlocksTransparency[i] * 15 ), ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
else
|
||||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 - leftBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "fill", 0, ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
love.graphics.setColor( 0, 0, 0, 1 - leftBlocksTransparency[i] )
|
||||
love.graphics.setColor( currentTheme.black[1], currentTheme.black[2], currentTheme.black[3], 1 - leftBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "line", 0, ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
end
|
||||
|
@ -1367,7 +1416,7 @@ function love.draw( dt )
|
|||
love.graphics.rectangle( "fill", love.graphics.getWidth() - 15 + ( rightBlocksTransparency[i] * 15 ),
|
||||
( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
love.graphics.setColor( 0, 0, 0, 1 )
|
||||
love.graphics.setColor( currentTheme.black )
|
||||
love.graphics.rectangle( "line", love.graphics.getWidth() - 15 + ( rightBlocksTransparency[i] * 15 ),
|
||||
( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
|
@ -1376,7 +1425,7 @@ function love.draw( dt )
|
|||
love.graphics.rectangle( "fill", love.graphics.getWidth() - 15,
|
||||
( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
love.graphics.setColor( 0, 0, 0, 1 - rightBlocksTransparency[i] )
|
||||
love.graphics.setColor( currentTheme.black[1], currentTheme.black[2], currentTheme.black[3], 1 - rightBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "line", love.graphics.getWidth() - 15,
|
||||
( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
15, blockLength )
|
||||
|
@ -1391,14 +1440,14 @@ function love.draw( dt )
|
|||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 )
|
||||
love.graphics.rectangle( "fill", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
0 - ( topBlocksTransparency[i] * 15 ), blockLength, 15 )
|
||||
love.graphics.setColor( 0, 0, 0, 1 )
|
||||
love.graphics.setColor( currentTheme.black )
|
||||
love.graphics.rectangle( "line", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
0 - ( topBlocksTransparency[i] * 15 ), blockLength, 15 )
|
||||
else
|
||||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 - topBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "fill", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
0, blockLength, 15 )
|
||||
love.graphics.setColor( 0, 0, 0, 1 - topBlocksTransparency[i] )
|
||||
love.graphics.setColor( currentTheme.black[1], currentTheme.black[2], currentTheme.black[3], 1 - topBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "line", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
0, blockLength, 15 )
|
||||
end
|
||||
|
@ -1411,14 +1460,14 @@ function love.draw( dt )
|
|||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 )
|
||||
love.graphics.rectangle( "fill", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
playAreaHeight - 15 + ( bottomBlocksTransparency[i] * 15 ), blockLength, 15 )
|
||||
love.graphics.setColor( 0, 0, 0, 1 )
|
||||
love.graphics.setColor( currentTheme.black )
|
||||
love.graphics.rectangle( "line", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
playAreaHeight - 15 + ( bottomBlocksTransparency[i] * 15 ), blockLength, 15 )
|
||||
else
|
||||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3], 1 - bottomBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "fill", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
playAreaHeight - 15, blockLength, 15 )
|
||||
love.graphics.setColor( 0, 0, 0, 1 - bottomBlocksTransparency[i] )
|
||||
love.graphics.setColor( currentTheme.black[1], currentTheme.black[2], currentTheme.black[3], 1 - bottomBlocksTransparency[i] )
|
||||
love.graphics.rectangle( "line", ( ( i - 1 ) * blockLength ) + ( math.sqrt( 2 ) * playerDistance ),
|
||||
playAreaHeight - 15, blockLength, 15 )
|
||||
end
|
||||
|
@ -1433,39 +1482,39 @@ function love.draw( dt )
|
|||
love.graphics.draw( ball.img, ball.prevX[i], ball.prevY[i] )
|
||||
end
|
||||
end
|
||||
love.graphics.setColor( ball.color )
|
||||
love.graphics.setColor( ball.color[1], ball.color[2], ball.color[3] )
|
||||
love.graphics.draw( ball.img, ball.x, ball.y )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
|
||||
drawCorners()
|
||||
|
||||
drawScore()
|
||||
|
||||
-- Player 1 paddles
|
||||
love.graphics.setColor( 0.9, 0, 0 )
|
||||
love.graphics.setColor( currentTheme.red )
|
||||
love.graphics.setLineWidth( 4 )
|
||||
love.graphics.rectangle( "line", player1.x + 4, playAreaHeight - ( 20 + playerDistance ) + 4, 92, 12 )
|
||||
love.graphics.setColor( 0.9, 0, 0, 0.5 )
|
||||
love.graphics.setColor( currentTheme.red[1], currentTheme.red[2], currentTheme.red[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.rectangle( "line", player1.x + 3, playAreaHeight - ( 20 + playerDistance ) + 3, 94, 14 )
|
||||
love.graphics.setColor( 0.9, 0, 0 )
|
||||
love.graphics.setColor( currentTheme.red )
|
||||
love.graphics.setLineWidth( 4 )
|
||||
love.graphics.rectangle( "line", playerDistance + 4, player1.y + 4, 12, 92 )
|
||||
love.graphics.setColor( 0.9, 0, 0, 0.5 )
|
||||
love.graphics.setColor( currentTheme.red[1], currentTheme.red[2], currentTheme.red[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.rectangle( "line", playerDistance + 3, player1.y + 3, 14, 94 )
|
||||
|
||||
-- Player 2 paddles
|
||||
love.graphics.setColor( 0, 0, 0.9 )
|
||||
love.graphics.setColor( currentTheme.blue )
|
||||
love.graphics.setLineWidth( 4 )
|
||||
love.graphics.rectangle( "line", player2.x + 4, playerDistance + 4, 92, 12 )
|
||||
love.graphics.setColor( 0, 0, 0.9, 0.5 )
|
||||
love.graphics.setColor( currentTheme.blue[1], currentTheme.blue[2], currentTheme.blue[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.rectangle( "line", player2.x + 3, playerDistance + 3, 94, 14 )
|
||||
love.graphics.setColor( 0, 0, 0.9 )
|
||||
love.graphics.setColor( currentTheme.blue )
|
||||
love.graphics.setLineWidth( 4 )
|
||||
love.graphics.rectangle( "line", love.graphics.getWidth() - ( 20 + playerDistance ) + 4, player2.y + 4, 12, 92 )
|
||||
love.graphics.setColor( 0, 0, 0.9, 0.5 )
|
||||
love.graphics.setColor( currentTheme.blue[1], currentTheme.blue[2], currentTheme.blue[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.rectangle( "line", love.graphics.getWidth() - ( 20 + playerDistance ) + 3, player2.y + 3, 14, 94 )
|
||||
love.graphics.setLineWidth( 1 )
|
||||
|
@ -1481,10 +1530,10 @@ function drawBackground()
|
|||
love.graphics.getWidth() - ( playerDistance / math.sqrt( 2 ) ),
|
||||
playAreaHeight - ( playerDistance / math.sqrt( 2 ) ),
|
||||
}
|
||||
love.graphics.setColor( 1, 0, 1, 0.5 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.line( linePoints )
|
||||
love.graphics.setColor( 1, 0, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] )
|
||||
love.graphics.setLineWidth( 1 )
|
||||
love.graphics.line( linePoints )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
|
@ -1493,7 +1542,7 @@ end
|
|||
-- Draw the corners
|
||||
function drawCorners()
|
||||
-- Corners
|
||||
love.graphics.setColor( 1, 0, 0, 0.75 )
|
||||
love.graphics.setColor( currentTheme.red[1], currentTheme.red[2], currentTheme.red[3], 0.75 )
|
||||
local trianglePoints = {
|
||||
0,
|
||||
playAreaHeight - ( math.sqrt( 2 ) * playerDistance ),
|
||||
|
@ -1521,7 +1570,7 @@ function drawCorners()
|
|||
playAreaHeight
|
||||
}
|
||||
love.graphics.polygon( "fill", trianglePoints )
|
||||
love.graphics.setColor( 0, 0, 1, 0.75 )
|
||||
love.graphics.setColor( currentTheme.blue[1], currentTheme.blue[2], currentTheme.blue[3], 0.75 )
|
||||
trianglePoints = {
|
||||
love.graphics.getWidth() - ( math.sqrt( 2 ) * playerDistance ),
|
||||
0,
|
||||
|
@ -1550,7 +1599,7 @@ function drawCorners()
|
|||
}
|
||||
love.graphics.polygon( "fill", trianglePoints )
|
||||
|
||||
love.graphics.setColor( 1, 0, 0, 0.375 )
|
||||
love.graphics.setColor( currentTheme.red[1], currentTheme.red[2], currentTheme.red[3], 0.375 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
local linePoints = {
|
||||
0,
|
||||
|
@ -1574,7 +1623,7 @@ function drawCorners()
|
|||
}
|
||||
love.graphics.line( linePoints )
|
||||
|
||||
love.graphics.setColor( 0, 0, 1, 0.375 )
|
||||
love.graphics.setColor( currentTheme.blue[1], currentTheme.blue[2], currentTheme.blue[3], 0.375 )
|
||||
linePoints = {
|
||||
love.graphics.getWidth() - ( math.sqrt( 2 ) * playerDistance ),
|
||||
0,
|
||||
|
@ -1603,10 +1652,10 @@ function drawCorners()
|
|||
playerDistance / math.sqrt( 2 ),
|
||||
playerDistance / math.sqrt( 2 )
|
||||
}
|
||||
love.graphics.setColor( 1, 0, 1, 0.5 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.line( linePoints )
|
||||
love.graphics.setColor( 1, 0, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] )
|
||||
love.graphics.setLineWidth( 1 )
|
||||
love.graphics.line( linePoints )
|
||||
linePoints = {
|
||||
|
@ -1615,10 +1664,10 @@ function drawCorners()
|
|||
love.graphics.getWidth(),
|
||||
playAreaHeight
|
||||
}
|
||||
love.graphics.setColor( 1, 0, 1, 0.5 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3], 0.5 )
|
||||
love.graphics.setLineWidth( 5 )
|
||||
love.graphics.line( linePoints )
|
||||
love.graphics.setColor( 1, 0, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.purple[1], currentTheme.purple[2], currentTheme.purple[3] )
|
||||
love.graphics.setLineWidth( 1 )
|
||||
love.graphics.line( linePoints )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
|
@ -1626,7 +1675,7 @@ end
|
|||
|
||||
function drawScore()
|
||||
-- Scoring background
|
||||
love.graphics.setColor( 0.5, 0, 0, 1 )
|
||||
love.graphics.setColor( currentTheme.darkRed )
|
||||
local rectanglePoints = {
|
||||
0,
|
||||
playAreaHeight,
|
||||
|
@ -1638,7 +1687,7 @@ function drawScore()
|
|||
love.graphics.getHeight()
|
||||
}
|
||||
love.graphics.polygon( "fill", rectanglePoints )
|
||||
love.graphics.setColor( 0, 0, 0.5, 1 )
|
||||
love.graphics.setColor( currentTheme.darkBlue )
|
||||
rectanglePoints = {
|
||||
( love.graphics.getWidth() / 2 ) - 25,
|
||||
playAreaHeight,
|
||||
|
@ -1650,7 +1699,7 @@ function drawScore()
|
|||
love.graphics.getHeight()
|
||||
}
|
||||
love.graphics.polygon( "fill", rectanglePoints )
|
||||
love.graphics.setColor( 1, 1, 1 )
|
||||
love.graphics.setColor( currentTheme.white[1], currentTheme.white[2], currentTheme.white[3] )
|
||||
|
||||
-- Player 1 score
|
||||
scoreFont = love.graphics.newFont( 40 )
|
||||
|
@ -1666,7 +1715,7 @@ end
|
|||
|
||||
function drawMenuBackground()
|
||||
drawCorners()
|
||||
love.graphics.setColor( 1, 0, 0, 0.5 )
|
||||
love.graphics.setColor( currentTheme.darkRed )
|
||||
local rectanglePoints = {
|
||||
0,
|
||||
playAreaHeight,
|
||||
|
@ -1678,7 +1727,7 @@ function drawMenuBackground()
|
|||
love.graphics.getHeight()
|
||||
}
|
||||
love.graphics.polygon( "fill", rectanglePoints )
|
||||
love.graphics.setColor( 0, 0, 1, 0.5 )
|
||||
love.graphics.setColor( currentTheme.darkBlue )
|
||||
rectanglePoints = {
|
||||
( love.graphics.getWidth() / 2 ) - 25,
|
||||
playAreaHeight,
|
||||
|
|
10
tags
10
tags
|
@ -12,6 +12,9 @@
|
|||
__newindex libraries/binser.lua /^ __newindex = function(_, _, v)$/;" f
|
||||
appendFile libraries/binser.lua /^ local function appendFile(path, ...)$/;" f
|
||||
check_custom_type libraries/binser.lua /^ local function check_custom_type(x, visited, accum)$/;" f
|
||||
denver.get libraries/denver.lua /^denver.get = function (args, ...)$/;" f
|
||||
denver.noteToFrequency libraries/denver.lua /^denver.noteToFrequency = function (note_str)$/;" f
|
||||
denver.set libraries/denver.lua /^denver.set = function (wave_type, osc)$/;" f
|
||||
deserialize libraries/binser.lua /^ local function deserialize(str, index)$/;" f
|
||||
deserializeN libraries/binser.lua /^ local function deserializeN(str, n, index)$/;" f
|
||||
deserialize_value libraries/binser.lua /^ local function deserialize_value(str, index, visited)$/;" f
|
||||
|
@ -41,6 +44,13 @@ normalize_template libraries/binser.lua /^ local function normalize_template(
|
|||
not_array_index libraries/binser.lua /^local function not_array_index(x, len)$/;" f
|
||||
number_from_str libraries/binser.lua /^local function number_from_str(str, index)$/;" f
|
||||
number_to_str libraries/binser.lua /^local function number_to_str(n)$/;" f
|
||||
oscillators.brownnoise libraries/denver.lua /^oscillators.brownnoise = function ()$/;" f
|
||||
oscillators.pinknoise libraries/denver.lua /^oscillators.pinknoise = function () -- http:\/\/www.musicdsp.org\/files\/pink.txt$/;" f
|
||||
oscillators.sawtooth libraries/denver.lua /^oscillators.sawtooth = function (f)$/;" f
|
||||
oscillators.sinus libraries/denver.lua /^oscillators.sinus = function (f)$/;" f
|
||||
oscillators.square libraries/denver.lua /^oscillators.square = function (f, pwm)$/;" f
|
||||
oscillators.triangle libraries/denver.lua /^oscillators.triangle = function (f)$/;" f
|
||||
oscillators.whitenoise libraries/denver.lua /^oscillators.whitenoise = function ()$/;" f
|
||||
overrideKeys main.lua /^function overrideKeys( player, key )$/;" f
|
||||
pack libraries/binser.lua /^local function pack(...)$/;" f
|
||||
readFile libraries/binser.lua /^ local function readFile(path)$/;" f
|
||||
|
|
Loading…
Reference in New Issue