Skip to content

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

@josh-perry

Description

@josh-perry
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions