Code: Select all
require ("Libraries/TEsound");
screenResolutionX = 1366; --setting variables to so I can use
screenResolutionY = 768; --them later for tricks
stage = 1;
xClick = 0;
yClick = 0;
love.graphics.setMode(screenResolutionX, screenResolutionY, true, true, 0);
love.mouse.setVisible(false);
function love.load() --loading all images and sounds
frontMenu = love.graphics.newImage ("FrontMenu.png");
newGame = love.graphics.newImage ("NewGame.png");
customCursor = love.graphics.newImage ("CustomCursor.png");
newGameButton = love.graphics.newImage ("NewGameButton.png");
exitGameButton = love.graphics.newImage ("ExitButton.png");
loadGameButton = love.graphics.newImage ("LoadGameButton.png");
encyclopediaGameButton = love.graphics.newImage ("EncyclopediaButton.png");
optionsGameButton = love.graphics.newImage ("OptionsButton.png");
creditsGameButton = love.graphics.newImage ("CreditsButton.png");
backGameButton = love.graphics.newImage ("BackButton.png");
love.filesystem.load ("FrontMenu.lua")();
TEsound.playLooping("MainMenuSound.wav","frontMenuSound");
end
Code: Select all
function love.draw()
love.graphics.draw (frontMenu, 0, 0);
love.graphics.draw (newGameButton, 1000, 150);
love.graphics.draw (loadGameButton, 1000, 230);
love.graphics.draw (optionsGameButton, 1000, 300);
love.graphics.draw (encyclopediaGameButton, 1000, 380);
love.graphics.draw (creditsGameButton, 1000, 460);
love.graphics.draw (exitGameButton, 1000, 530);
love.graphics.draw (customCursor, love.mouse.getX(), love.mouse.getY());
end
function love.update(dt)
TEsound.tagVolume("all",.5);
TEsound.cleanup();
function love.mousepressed (x, y, click)
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 150 and y <= 210 then
local check = 1;
function love.mousereleased (x1, y1, click1)
if click1 == "l" and x1 >= 1000 and x1 <= 1177 and y1 >= 150 and y1 <= 210 and check == 1 then
TEsound.play ("/Sounds/beep.wav", "clickButton");
stage = 2;
love.filesystem.load ("NewGame.lua")();
check = 0;
else check = 0;
end
end
end
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 230 and y <= 280 then
local check = 1;
function love.mousereleased (x1, y1, click1)
if click1 == "l" and x1 >= 1000 and x1 <= 1177 and y1 >= 230 and y1 <= 280 and check == 1 then
stage = 3;
love.filesystem.load ("LoadGame.lua")();
check = 0;
else check = 0;
end
end
end
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 300 and y <= 360 then
local check = 1;
function love.mousereleased (x1, y1, click1)
if click1 == "l" and x1 >= 1000 and x1 <= 1177 and y1 >= 300 and y1 <= 360 and check == 1 then
stage = 4;
love.filesystem.load ("Options.lua")();
check = 0;
else check = 0;
end
end
end
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 380 and y <= 440 then
local check = 1;
function love.mousereleased (x1, y1, click1)
if click1 == "l" and x1 >= 1000 and x1 <= 1177 and y1 >= 380 and y1 <= 440 and check == 1 then
stage = 5;
love.filesystem.load ("Encyclopedia.lua")();
check = 0;
else check = 0;
end
end
end
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 460 and y <= 520 then
local check = 1;
function love.mousereleased (x, y, click1)
if click1 == "l" and x >= 1000 and x <= 1177 and y >= 460 and y <= 520 then
stage = 6;
love.filesystem.load ("Credits.lua")();
end
end
end
if click == "l" and stage == 1 and x >= 1000 and x <= 1177 and y >= 540 and y <= 600 then
function love.mousereleased (x, y, click1)
if click1 == "l" and x >= 1000 and x <= 1177 and y >= 540 and y <= 600 then
love.event.push("q");
end
end
end
end
function love.keyreleased (key)
if key == "n" and stage == 1 then
stage = 2;
love.filesystem.load ("NewGame.lua")();
end
if key == "l" and stage == 1 then
stage = 3;
love.filesystem.load ("LoadGame.lua")();
end
if key == "o" and stage == 1 then
stage = 4;
love.filesystem.load ("Options.lua")();
end
if key == "e" and stage == 1 then
stage = 5;
love.filesystem.load ("Encyclopedia.lua")();
end
if key == "c" and stage == 1 then
stage = 6;
love.filesystem.load ("Credits.lua")();
end
if key == "q" and stage == 1 then
love.event.push("q");
end
end
end