Need some help in using hump
Posted: Sun Mar 23, 2014 10:48 pm
Hi all,
I want to have some states in my game such as 'menu', 'options', 'help' etc. The idea is to load a splash screen initially and continue from there based on player input. I looked around the forum and decided on hump to achieve 'state' function in my game. But I don't think i'm doing it right love doesn't load the splash screen. Here' my code in my main.lua. Any help is appreciated. Thank you
I want to have some states in my game such as 'menu', 'options', 'help' etc. The idea is to load a splash screen initially and continue from there based on player input. I looked around the forum and decided on hump to achieve 'state' function in my game. But I don't think i'm doing it right love doesn't load the splash screen. Here' my code in my main.lua. Any help is appreciated. Thank you
Code: Select all
menu = {}
function menu:init() --loading and drawing a splash screen
splash = love.graphics.newImage("splash.png")
end
function menu:draw()
love.graphics.draw(splash, game_width, game_height)
end
function love.load()
Gamestate.registerEvents()
Gamestate.switch(menu)
bg = {0,153,76}
love.graphics.setBackgroundColor(bg)
end