Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No other state callbacks get called if theres no update #133

Open
josh-perry opened this issue Jul 4, 2024 · 0 comments
Open

No other state callbacks get called if theres no update #133

josh-perry opened this issue Jul 4, 2024 · 0 comments

Comments

@josh-perry
Copy link

local Gamestate = require("hump.gamestate")

local ingame = {}

function ingame:draw()
    love.graphics.print("Hello, World!", 10, 10)
end

--

function love.load()
    Gamestate.switch(ingame)
end

function love.update(dt)
    --Gamestate.update(dt)
end

function love.draw()
    Gamestate.draw()
end

This code silently doesn't work. The state callbacks are completely ignored unless theres an update first, which seems to be intentionalish (#46). Uncommenting Gamestate.update works as expected.

-- call function only if at least one 'update' was called beforehand

The fix for #46 really needs to be reverted, it causes this bug as well as the infamous single black screen (see: #46 (comment)) bug when switching states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant