hump icon indicating copy to clipboard operation
hump copied to clipboard

No other state callbacks get called if theres no update

Open josh-perry opened this issue 1 year ago • 0 comments

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.

https://github.com/vrld/hump/blob/08937cc0ecf72d1a964a8de6cd552c5e136bf0d4/gamestate.lua#L102

The fix for #46 really needs to be reverted, it causes this bug as well as the infamous single black screen (see: https://github.com/vrld/hump/issues/46#issuecomment-1130329797) bug when switching states.

josh-perry avatar Jul 04 '24 08:07 josh-perry