Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions menus/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ function menu.load(menuManager, screen)
{
label = getString(strings.play),
callback = function()
sounds.play(sounds.uiClick)
menu.menuManager:changeMenuTo(
nil,
function()
changeScreen(require("screens/game"))
menu.menuManager:init()
end,
true
)
if menu.menuManager.screenState == menu.menuManager.screenStates.showingMenu then
sounds.play(sounds.uiClick)
menu.menuManager:changeMenuTo(
nil,
function()
changeScreen(require("screens/game"))
menu.menuManager:init()
end,
true
)
end
end,
},
{
Expand All @@ -40,6 +42,22 @@ function menu.load(menuManager, screen)
end
end
},
{
label = getString(strings.credits),
callback = function()
if menu.menuManager.screenState == menu.menuManager.screenStates.showingMenu then
sounds.play(sounds.uiClick)
menu.menuManager:changeMenuTo(
nil,
function()
changeScreen(require("screens/credits"))
menu.menuManager:init()
end,
true
)
end
end
},
{
label = getString(strings.quit),
callback = function()
Expand All @@ -51,7 +69,7 @@ function menu.load(menuManager, screen)
}
menu.widgets = {}
for i = 1, #buttons do
table.insert(menu.widgets, widgetsClass.newButton(buttons[i].label, SCREEN_WIDTH * 0.15, 50 + i * SCREEN_HEIGHT * 0.16, SCREEN_WIDTH * 0.7, SCREEN_HEIGHT * 0.13, buttons[i].callback, font_buttons))
table.insert(menu.widgets, widgetsClass.newButton(buttons[i].label, SCREEN_WIDTH * 0.15, 50 + i * SCREEN_HEIGHT * 0.14, SCREEN_WIDTH * 0.7, SCREEN_HEIGHT * 0.12, buttons[i].callback, font_buttons))
end
end

Expand All @@ -63,7 +81,7 @@ end

function menu.draw()
love.graphics.setBlendMode("alpha")
love.graphics.printf( "Dizzy Balloon", font_title, 0, SCREEN_HEIGHT * 0.1, 1280, "center")
love.graphics.printf("Dizzy Balloon", font_title, 0, SCREEN_HEIGHT * 0.09, 1280, "center")
for i = 1, #menu.widgets do
menu.widgets[i].draw()
end
Expand Down
4 changes: 4 additions & 0 deletions misc/strings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
local strings = {
credits = {
es = "Créditos",
en = "Credits"
},
quit = {
es = "Salir",
en = "Exit"
Expand Down
78 changes: 78 additions & 0 deletions screens/credits.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
--[[
#font:edunline,20
.start
Dizzy Balloon
.end
#font:otrafuente,14
.start
Made with Love <3 by:
.end
.start
__ __
\ \ / /_ _ __ _ ___
\ V / _` |/ _` |/ _ \
| | (_| | (_| | (_) |
|_|\__,_|\__, |\___/
|___/
_______________Yago_F_F_
.end
.start
_ _
/ \ | | _____ __
/ _ \ | |/ _ \ \/ /
/ ___ \| | __/> <
/_/ \_\_|\___/_/\_\

_________Alejandro_S_P_
.end
.start
____________Marcos_F_P_
.end
.start
#images:una.jpg,dos.jpg,tres.jpg
.end

]]
local screen = {
name = "Pantalla créditos"
}

-- carga este screen
function screen.load()
-- música
--TODO: Deberíamos poner otra música
loadAndStartMusic({file = "menu.mp3", volume = 1})
-- animaciones
end

function screen.update(dt)
end

function screen.draw()
love.graphics.clear(1, 0, 1)
love.graphics.push()
love.graphics.translate(desplazamientoX, desplazamientoY)
love.graphics.scale(factorEscala, factorEscala)
--love.graphics.setColor(255, 0, 0, 255)
-- DEBUG: marcas en los extremos diagonales de la pantalla
love.graphics.setColor(255, 0, 0)
love.graphics.line(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1)
love.graphics.pop()
end

function screen.keypressed(key, scancode, isrepeat)
changeScreen(require("screens/menu"))
end

function screen.keyreleased(key, scancode, isrepeat)
end

function love.mousepressed(x, y, button, istouch, presses)
changeScreen(require("screens/menu"))
end

function love.touchpressed(id, x, y, dx, dy, pressure)
changeScreen(require("screens/menu"))
end

return screen