Browse Source

0.7.2 Update

tags/chalkboard
madiwka3 3 years ago
parent
commit
901d1eb5bf
7 changed files with 87 additions and 45 deletions
  1. BIN
      audio/theme3.mp3
  2. +8
    -13
      main.lua
  3. +7
    -0
      main2.lua
  4. +20
    -15
      mainMenu.lua
  5. +16
    -3
      music.lua
  6. +2
    -1
      roadmap
  7. +34
    -13
      src/baseGame.lua

BIN
audio/theme3.mp3 View File


+ 8
- 13
main.lua View File

@@ -68,7 +68,7 @@ craz = 0
AI_LEVEL = 500
isFullscreen = 0
prtext = "Easy"
MAP_TYPE = 2
MAP_TYPE = 0
difficultyl = 300
req = "pp"
ballSet = 200
@@ -445,15 +445,6 @@ function love.load()
end
)
)
table.insert(
modeSelectorButtons,
newButton(
"Nuclear Practice",
function()
gameState = "prdiff"
end
)
)
table.insert(
modeSelectorButtons,
newButton(
@@ -509,6 +500,7 @@ function love.load()
function()
speedSetter("reset")
gameState = "menu"
end
)
)
@@ -528,6 +520,7 @@ function love.load()
function()
AGAINST_AI = 0
gameState = "1serve"
globalState = "base"
end
)
)
@@ -633,12 +626,13 @@ function startShake(duration, magnitude)
end
function displayFPS()
--love.window.setTitle(love.timer.getFPS())
love.window.setTitle(gameState .. " " .. gameMode .. " " .. globalState .. " " .. MAP_TYPE)
love.window.setTitle(globalState .. " " .. gameState)
if love.keyboard.isDown("space") then
player1nukescore = 200
player1score = 9
player2score = 9
player1score = player1score + 0.2
player2nukescore = 200
end
end

function speedControl()
@@ -650,6 +644,7 @@ end
function love.update(dt)
staticanimatorcounter(dt)
musicController('norm', 1)
if debug then
displayFPS()
end


+ 7
- 0
main2.lua View File

@@ -1,4 +1,11 @@
--CALLING OTHER LUA FILES
--
--THIS IS LEGACY CODE FOR NUCLEAR PONG
--
--IT WILL *NOT* WORK!
--
--I ONLY KEEP IT TO SQUASH BUGS HERE AND THERE
--
require 'src/dependencies'
io.stdout:setvbuf('no')
--CANCELLED ATTEMPETED SHADING (NOT WORKING)


+ 20
- 15
mainMenu.lua View File

@@ -78,8 +78,8 @@ function mainMenu:butt(gameState, VIRTUAL_WIDTH, VIRTUAL_HEIGHT, buttons, sounds
ev_bx = -400
ev_by = -400
else
ev_bx = locationx - (ev_button_width * 0.5)
ev_by = locationy - (total_height * 0.5) + cursor_y
ev_bx = locationx - (ev_button_width * 0.5)
ev_by = locationy - (total_height * 0.5) + cursor_y
end
if (button.text == 'Play') and location == 'playercount' then color = {0/255, 255/255, 0/255, 255} else
color = {10, 10, 0, 255}
@@ -110,22 +110,27 @@ function mainMenu:butt(gameState, VIRTUAL_WIDTH, VIRTUAL_HEIGHT, buttons, sounds
local textW = smallfont:getWidth(button.text)
local textH = smallfont:getHeight(button.text)
if (location == 'control') then
if danger == button.text or danger2 == button.text then
love.graphics.setColor(1,0,0,1)
else
love.graphics.setColor(0,0,0,1)
end
if (button.text == "1up") then
love.graphics.print("Player 1 UP: " .. string.upper(p1control.up), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P1 UP: " .. string.upper(p1control.up), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '2up' then
love.graphics.print("Player 2 UP: " .. string.upper(p2control.up), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P2 UP: " .. string.upper(p2control.up), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '1down' then
love.graphics.print("Player 1 DOWN: " .. string.upper(p1control.down), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P1 DOWN: " .. string.upper(p1control.down), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '2down' then
love.graphics.print("Player 2 DOWN: " .. string.upper(p2control.down), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P2 DOWN: " .. string.upper(p2control.down), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '1special' then
love.graphics.print("Player 1 SPECIAL: " .. string.upper(p1control.super), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P1 SPECIAL: " .. string.upper(p1control.super), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '2special' then
love.graphics.print("Player 2 SPECIAL: " .. string.upper(p2control.super), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P2 SPECIAL: " .. string.upper(p2control.super), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '1ct' then
love.graphics.print("Player 1 COUNTER: " .. string.upper(p1control.counter), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P1 COUNTER: " .. string.upper(p1control.counter), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
elseif button.text == '2ct' then
love.graphics.print("Player 2 COUNTER: " .. string.upper(p2control.counter), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
love.graphics.print("P2 COUNTER: " .. string.upper(p2control.counter), smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
else
love.graphics.print(button.text, smallfont, ev_bx + (ev_button_width * 0.1), ev_by+textH*0.5)
@@ -137,15 +142,15 @@ function mainMenu:butt(gameState, VIRTUAL_WIDTH, VIRTUAL_HEIGHT, buttons, sounds
elseif button.text == 'snc' then
if (nuckemodactive == 1) then
love.graphics.setColor(1,0,0,1)
love.graphics.print(synctext, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.5, ev_by+textH*0.5)
love.graphics.print(synctext, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.7, ev_by+textH*0.5)
love.graphics.setColor(1,1,1,1)
love.graphics.print(synctext, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.5, ev_by+textH*0.5)
love.graphics.print(synctext, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.7, ev_by+textH*0.5)
love.graphics.setColor(0,0,0,1)
else
love.graphics.print(synctext, smallfont, VIRTUAL_WIDTH*0.45 - textW*0.5, ev_by+textH*0.5)
end
elseif (button.text == 'ballCount') then
love.graphics.print("Ball Count: " .. maxBalls, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.5, ev_by+textH*0.5)
love.graphics.print("Ball Count: " .. maxBalls, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.7, ev_by+textH*0.5)
elseif (button.text == "Ball Speed: ") then
if (nuckemodactive == 1) then
@@ -156,10 +161,10 @@ function mainMenu:butt(gameState, VIRTUAL_WIDTH, VIRTUAL_HEIGHT, buttons, sounds
love.graphics.setColor(0,0,0,1)
else
love.graphics.print(button.text .. ballSet, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.5, ev_by+textH*0.5)
love.graphics.print(button.text .. ballSet, smallfont, VIRTUAL_WIDTH*0.5 - textW*0.6, ev_by+textH*0.5)
end
elseif button.text == 'ptw' then
love.graphics.print("Points to Win: " .. ptw, smallfont,VIRTUAL_WIDTH*0.5 - textW * 1.5, ev_by+textH*0.5)
love.graphics.print("Points to Win: " .. ptw, smallfont,VIRTUAL_WIDTH*0.5 - textW * 2.8, ev_by+textH*0.5)
elseif (button.text == 'Silverblade') then
love.graphics.print("Difficulty: " .. prtext, smallfont, VIRTUAL_WIDTH*0.5 - textW , ev_by+textH*0.5)
else


+ 16
- 3
music.lua View File

@@ -1,8 +1,9 @@
function musicController(orders, toggling)
if (orders == 'norm') then
if (gameState ~= 'play' and gameState ~= '1serve' and gameState ~= '2serve' and areanuclear == 0) then
if (globalState == 'menu') then
sounds['gayTheme']:stop()
sounds['gayTheme2']:stop()
sounds['gayTheme3']:stop()
sounds['updateMusic']:play()
elseif (areanuclear == 1) then
sounds['gayTheme']:setVolume(0)
@@ -10,18 +11,30 @@ function musicController(orders, toggling)
elseif ((gameState == 'play' or gameState == '1serve' or gameState == '2serve') and player1score <= 7 and player2score <= 7 and areanuclear == 0) then
sounds['updateMusic']:stop()
sounds['gayTheme2']:stop()
sounds['gayTheme3']:stop()
sounds['gayTheme']:setPitch(1)
sounds['gayTheme']:setLooping(true)
sounds['gayTheme']:setVolume(0.5)
sounds['gayTheme']:play()
elseif gameState == 'play' and player1score > 7 or player2score > 7 and areanuclear == 0 then
elseif gameState == 'play' and player1score > ptw-2 or player2score > ptw-2 and areanuclear == 0 then
print(ptw-2)
sounds['gayTheme']:stop()
sounds['gayTheme3']:stop()
sounds['updateMusic']:stop()
sounds['gayTheme2']:setPitch(1)
sounds['gayTheme2']:setLooping(true)
sounds['gayTheme2']:setVolume(0.5)
sounds['gayTheme2']:play()
else
elseif gameState == 'play' and player1score > ptw-4 or player2score > ptw-4 and areanuclear == 0 then
print(ptw-4)
sounds['gayTheme']:stop()
sounds['gayTheme2']:stop()
sounds['updateMusic']:stop()
sounds['gayTheme3']:setPitch(1)
sounds['gayTheme3']:setLooping(true)
sounds['gayTheme3']:setVolume(0.5)
sounds['gayTheme3']:play()
end
elseif orders ~= nil then


+ 2
- 1
roadmap View File

@@ -1,2 +1,3 @@
TODO: Change nuclear explosions to be handled by the animatior --COMPLETE
TODO: For the love of god make love.draw limited to drawing only.
TODO: For the love of god make love.draw limited to drawing only. --COMPLETE
TODO: Make up new moves

+ 34
- 13
src/baseGame.lua View File

@@ -7,7 +7,7 @@ function basegame(dt)
end
speedControl()
balancer()
musicController('norm', 1)
if t < shakeDuration then
t = t + dt
end
@@ -85,7 +85,7 @@ function basegame(dt)
for i = 1, maxBalls do
if ball[i]:collides(player1) then
if (areanuclear == 0 and striken == 1 and (player1score > 8 or player2score > 8)) then
if (areanuclear == 0 and striken == 1 and (player1score > ptw-2 or player2score > ptw-2)) then
print("Calling animation")
superanimator("tensehit", 1)
end
@@ -118,6 +118,7 @@ function basegame(dt)
sounds["nuclearhit"]:setPitch(1)
sounds["nuclearhit"]:play()
end
superanimator("tensehit", 1)
else
if areanuclear == 0 then
sounds["beep"]:setPitch(ballSpeed / 250)
@@ -128,6 +129,7 @@ function basegame(dt)
end
end
if (striken == 1) then
player1nukescore = player1nukescore * 1.2
if (synctype == 0) then
paddle_SPEED = paddle_SPEED * 1.10
@@ -208,7 +210,7 @@ function basegame(dt)
shakeDuration = 1
if
(areanuclear == 0 and
(striken == 1 and (player1score > 8 or player2score > 8)))
(striken == 1 and (player1score > ptw-2 or player2score > ptw-2)))
then
superanimator("tensehit", 2)
end
@@ -229,7 +231,7 @@ function basegame(dt)
potentialnuke2 = 0
player2nukescore = 0
potentialstrike2 = 0
superanimator("tensehit", 2)
if areanuclear == 0 then
sounds["striking"]:setPitch(ballSpeed / 250)
sounds["striking"]:play()
@@ -238,6 +240,7 @@ function basegame(dt)
sounds["nuclearhit"]:play()
end
elseif (striken == 1) then
player2nukescore = player2nukescore * 1.5
if (synctype == 0) then
paddle_SPEED = paddle_SPEED * 1.10
@@ -389,7 +392,7 @@ end
function debugCheck(dt)
if (gameState == "menu") then
updateTEXT = "0.7.1 Chalkboard Update"
updateTEXT = "0.7.2 Chalkboard Update"
end
dangerChecker()
elapsed = elapsed + dt
@@ -486,7 +489,7 @@ function powerAvailability()
player1reverbav = 0
end
end
if (player1nukescore >= 140) and timeIsSlow2 == false and timeIsSlow == false and maxBalls == 1 and ball[1].x < VIRTUAL_WIDTH / 2 then
if (player1nukescore >= 140) and timeIsSlow2 == false and timeIsSlow == false and maxBalls == 1 and ball[1].x < VIRTUAL_WIDTH / 2 and ball[1].dx < 0 then
player1reverbav = 1
if love.keyboard.isDown(p1control.counter) then
powerControl(1, "special")
@@ -529,7 +532,7 @@ function powerAvailability()
end
end
end
if (player2nukescore >= 140) and timeIsSlow == false and timeIsSlow2 == false and maxBalls == 1 and ball[1].x > VIRTUAL_WIDTH / 2 then
if (player2nukescore >= 140) and timeIsSlow == false and timeIsSlow2 == false and maxBalls == 1 and ball[1].x > VIRTUAL_WIDTH / 2 and ball[1].dx > 0 then
player2reverbav = 1
if love.keyboard.isDown(p2control.counter) then
sounds["time"]:play()
@@ -803,7 +806,7 @@ function displayPoints()
else
love.graphics.print(tostring("READY"), VIRTUAL_WIDTH / 2 - 500, VIRTUAL_HEIGHT / 60)
end
elseif (player1reverbav == 1 and potentialnuke1 == 0) then
elseif (player1reverbav == 1 and potentialnuke1 == 0 and maxBalls == 1) then
love.graphics.print(
tostring(
math.floor(player1nukescore) .. "[" .. p1control.super .. "]" .. " [" .. p1control.counter .. "]"
@@ -811,7 +814,7 @@ function displayPoints()
VIRTUAL_WIDTH / 2 - 500,
VIRTUAL_HEIGHT / 60
)
elseif (potentialnuke1 == 1) then
elseif (potentialnuke1 == 1 and maxBalls == 1) then
love.graphics.setColor(255, 0, 0, 255)
love.graphics.print(
tostring(
@@ -821,6 +824,16 @@ function displayPoints()
VIRTUAL_HEIGHT / 60
)
love.graphics.setColor(255, 255, 255, 255)
elseif (potentialnuke1 == 1) then
love.graphics.setColor(255, 0, 0, 255)
love.graphics.print(
tostring(
math.floor(player1nukescore) .. "[" .. p1control.super .. "]"
),
VIRTUAL_WIDTH / 2 - 500,
VIRTUAL_HEIGHT / 60
)
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.print(tostring(math.floor(player1nukescore)), VIRTUAL_WIDTH / 2 - 500, VIRTUAL_HEIGHT / 60)
end
@@ -834,18 +847,26 @@ function displayPoints()
else
love.graphics.print(tostring("READY"), VIRTUAL_WIDTH / 2 + 430, VIRTUAL_HEIGHT / 60)
end
elseif (potentialnuke2 == 1) then
elseif (potentialnuke2 == 1 and maxBalls == 1) then
love.graphics.setColor(255, 0, 0, 255)
love.graphics.print(
tostring(math.floor(player2nukescore) .. "[" .. p2control.super .. "] [" .. p2control.counter .. "]"),
VIRTUAL_WIDTH / 2 + 400,
VIRTUAL_HEIGHT / 60
)
love.graphics.setColor(255, 255, 255, 255)
elseif (potentialnuke2 == 1 and maxBalls > 1) then
love.graphics.setColor(255, 0, 0, 255)
love.graphics.print(
tostring(math.floor(player2nukescore) .. "[" .. p2control.super .. "]"),
VIRTUAL_WIDTH / 2 + 430,
VIRTUAL_HEIGHT / 60
)
love.graphics.setColor(255, 255, 255, 255)
elseif (player2reverbav == 1 and potentialnuke2 == 0) then
love.graphics.setColor(255, 255, 255, 255)
elseif (player2reverbav == 1 and potentialnuke2 == 0 and maxBalls == 1) then
love.graphics.print(
tostring(math.floor(player2nukescore) .. "[" .. p2control.super .. "] [" .. p2control.counter .. "]"),
VIRTUAL_WIDTH / 2 + 430,
VIRTUAL_WIDTH / 2 + 400,
VIRTUAL_HEIGHT / 60
)
else


Loading…
Cancel
Save