Agent skill

love-event

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/love-event

SKILL.md

When to use this skill

{{SKILL_DESCRIPTION}} Use this skill when working with event management, event callbacks, event pumping, or any event-related operations in LÖVE games.

Common use cases

  • Managing game events and callbacks
  • Implementing custom event handling systems
  • Working with event queues and pumping
  • Handling system and user-generated events
  • Managing event flow and propagation

{{MODULES_LIST}} {{FUNCTIONS_LIST}} {{CALLBACKS_LIST}} {{TYPES_LIST}} {{ENUMS_LIST}}

Examples

Custom event handling

lua
-- Pump and handle events manually
function love.update(dt)
  love.event.pump()

  for name, a, b, c, d, e, f in love.event.poll() do
    if name == "quit" then
      if not love.quit or not love.quit() then
        return a or 0
      end
    end
    -- Handle other events
  end
end

Event callback

lua
-- Custom quit handler
function love.quit()
  -- Save game state before quitting
  saveGameState()
  return false  -- Allow normal quit process
end

Best practices

  • Use love.event.pump() regularly to process events
  • Handle quit events gracefully
  • Consider performance when polling events frequently
  • Test event handling on different platforms
  • Be mindful of event queue limits

Platform compatibility

  • Desktop (Windows, macOS, Linux): Full event support
  • Mobile (iOS, Android): Full support
  • Web: Full support

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results