Reference

Lusk

Lusk.

class lusk.EventHandler

Handles events that happen within the game context.

handle_event(event)

Takes an individual event object and handles accordingly.

Currently this is just going through a glorified switch statement but in the future this should have a more robust setup that will allow for scene switching (like changing buttons from the main menu to the in-game button mapping as well as re-mapping)

This needs to be an async def because the calling function is async and will expect it.

Parameters

event (Event) –

Return type

None

class lusk.Lusk(config)

The main game object that holds state for the game.

Parameters

config (str) –

Return type

None

async lusk.start_loop(game_instance, framerate_limit=inf)

Acts as the main game event loop.

The pygame loop performs a number of functions:
  • Waits for and responds to user input.

  • Draws things to the screen.

  • Handles game logic.

  • Accepts and responds to network calls. This part we won’t be doing just yet, it is possible in the future that network play will be added, but that will definitely be a >1.0 edition item.

Parameters

framerate_limit (float) –

Return type

None