Code: Select all
if key == " " then
Code: Select all
if key == "space" then
Code: Select all
if key == " " then
Code: Select all
if key == "space" then
Haha, thanks for pointing that out. This library is ancient, you might need to do some tweaking inside it's own code to make it do what you want, but it should still work mostly.D0NM wrote:There is an error in menuState.lua example file due to the new LOVE 0.10should be replaced withCode: Select all
if key == " " then
thanks for the lib, I'm going to use it.Code: Select all
if key == "space" then
Well, I'm glad to hear that. I hope you'll enjoy using it.D0NM wrote:Actually, I did some tweaking before my message. It sure works with my project.
And it made my day.
The WIKI page leads to some old stuff. So blame it ))
I like LOVE2d more and more.
Code: Select all
lovelyMoon.event.update(dt)
lovelyMoon.event.draw()
lovelyMoon.event.keypressed(key, unicode)
lovelyMoon.event.keyreleased(key, unicode)
lovelyMoon.event.mousepressed(x, y, button)
lovelyMoon.event.mousereleased(x, y, button)
lovelyMoon.new(self) -- Initializes a new state; call from: function state:new()
lovelyMoon.addState(file, id) -- return state; file argument is used for require.
lovelyMoon.isStateEnabled(id) -- return bool
lovelyMoon.getState(id) -- return state
lovelyMoon.enableState(id)
lovelyMoon.disableState(id)
lovelyMoon.switchState(currentID, nextID)
lovelyMoon.toggleState(id)
lovelyMoon.destroyState(id)
Code: Select all
lovelyMoon = require("lib.lovelyMoon")
states = {}
Code: Select all
function love.load()
states.menu = lovelyMoon.addState("states.menu", "menu") -- Argument 1 is file path for require
states.game = lovelyMoon.addState("states.game", "game")
lovelyMoon.enableState("menu")
end
Code: Select all
function love.update(dt)
lovelyMoon.event.update(dt)
end
function love.draw()
lovelyMoon.event.draw()
end
function love.keypressed(key, unicode)
lovelyMoon.event.keypressed(key, unicode)
end
function love.keyreleased(key, unicode)
lovelyMoon.event.keyreleased(key, unicode)
end
function love.mousepressed(x, y, button)
lovelyMoon.event.mousepressed(x, y, button)
end
function love.mousereleased(x, y, button)
lovelyMoon.event.mousereleased(x, y, button)
end
Code: Select all
local state = {}
function state:new()
return lovelyMoon.new(self)
end
function state:load()
end
function state:close()
end
function state:enable()
end
function state:disable()
end
function state:update(dt)
end
function state:draw()
end
function state:keypressed(key, unicode)
end
function state:keyreleased(key, unicode)
end
function state:mousepressed(x, y, button)
end
function state:mousereleased(x, y, button)
end
return state
Wow, I am blown away at the amount of work you put into this otherwise dead library!bVictor7364 wrote:...
Thank you, I found your library very useful, but it needed some improvement. The gamestate mechanism I designed was at least uncomfortable. But your solution is pretty elegant, so it was worth reviving. And I'd be happy if you use it as a new version of your library!Davidobot wrote: Wow, I am blown away at the amount of work you put into this otherwise dead library!
I looked through your code - this is some major improvement. Hell, I might even use your version for my latest project. Thanks a lot for your work! It will find good use I'm sure.
Do you mind if I link your reply in the main post?
Thank you! I updated the OP!bVictor7364 wrote: Thank you, I found your library very useful, but it needed some improvement. The gamestate mechanism I designed was at least uncomfortable. But your solution is pretty elegant, so it was worth reviving. And I'd be happy if you use it as a new version of your library!
Yes, I'm using it in my current project so I'll be adding stuff to it and fixing any bugs.
Users browsing this forum: Bing [Bot] and 1 guest