escapy

User Guide

  • Getting Started
    • Requirements
    • Installation
      • From source (development)
      • As a dependency
    • Project layout
    • Your first game
    • Running tests
  • Architecture
    • Overview
    • Key design decisions
      • Commands are first-class values
      • Protocols over base classes
      • Events decouple logic from presentation
      • Mixins for shared behaviour
    • Game loop
    • Module dependency graph
  • Game Objects
    • Common parameters
    • PickableObject
    • SelfSimpleLock
    • SelfKeyLock
    • SelfAskCodeLock
    • MoveToRoom
    • WinMachine
    • InspectableObject
    • PickableInspectableObject
    • MoveToRoomAndAddToInventoryObject
    • Creating custom objects
  • Commands
    • Basic commands
      • no_op() → Command
      • pick(id) → Command
      • put_in_hand(id) → Command
      • inspect(id) → Command
      • reveal(object_id, room_id, position) → Command
      • move_to_room(room_id) → Command
      • add_to_inventory(object_id) → Command
    • Lock commands
      • simple_lock(id) → Command
      • key_lock(id, key_id) → Command
      • ask_for_code(id) → Command
      • locked(id) → Command
    • Combinators
      • combine(*commands) → Command
      • cond(*clauses) → Command
      • chain(*clauses) → Command
  • Events
    • Event union type
    • Event reference
      • PickedUpEvent
      • PutInHandEvent
      • PutOffHandEvent
      • InteractedWithLockedEvent
      • UnlockedEvent
      • RevealedEvent
      • MovedToRoomEvent
      • AskedForCodeEvent
      • WrongCodeEvent
      • InspectedEvent
      • GameEndedEvent
      • AddedToInventoryEvent
    • Using events with messages
  • Protocols
    • GameProtocol
    • Command
    • Object protocols
      • Interactable
      • InventoryInteractable
      • Placeable
      • Unlockable
      • Decodable
    • GameUiProtocol
    • Runtime checking
  • Pygame UI
    • Configuration
      • Required keys
      • Optional keys
      • Object image keys
    • Screen layout
    • UI states
      • Normal
      • InsertCode
      • Inspect
    • Messages
    • Game loop

API Reference

  • escapy
    • escapy.protocols
      • escapy.protocols.game
      • escapy.protocols.objects
      • escapy.protocols.ui
    • escapy.pygame
      • PyGameUi
        • PyGameUi.init()
        • PyGameUi.tick()
        • PyGameUi.input()
        • PyGameUi.render()
        • PyGameUi.handle()
        • PyGameUi.quit()
        • PyGameUi.add_message()
      • escapy.pygame.pygame_ui
        • PyGameUi
  • escapy.types
    • Position
      • Position.x
      • Position.y
    • Room
  • escapy.events
    • PickedUpEvent
      • PickedUpEvent.object_id
    • PutInHandEvent
      • PutInHandEvent.object_id
    • PutOffHandEvent
    • InteractedWithLockedEvent
      • InteractedWithLockedEvent.object_id
    • UnlockedEvent
      • UnlockedEvent.object_id
    • RevealedEvent
      • RevealedEvent.object_id
      • RevealedEvent.room_id
      • RevealedEvent.position
    • MovedToRoomEvent
      • MovedToRoomEvent.room_id
    • AskedForCodeEvent
      • AskedForCodeEvent.object_id
    • WrongCodeEvent
    • InspectedEvent
      • InspectedEvent.object_id
    • GameEndedEvent
    • AddedToInventoryEvent
      • AddedToInventoryEvent.object_id
    • Event
  • escapy.commands
    • no_op()
    • pick()
    • put_in_hand()
    • simple_lock()
    • key_lock()
    • ask_for_code()
    • locked()
    • inspect()
    • reveal()
    • move_to_room()
    • add_to_inventory()
    • combine()
    • cond()
    • chain()
  • escapy.game
    • Game
      • Game.quit()
      • Game.interact()
      • Game.interact_inventory()
      • Game.insert_code()
  • escapy.objects
    • PickableObject
    • SelfSimpleLock
    • SelfKeyLock
    • SelfAskCodeLock
    • MoveToRoom
    • WinMachine
    • InspectableObject
    • PickableInspectableObject
    • MoveToRoomAndAddToInventoryObject
  • escapy.mixins
    • UnlockableMixin
      • UnlockableMixin.unlock()
    • DecodableMixin
      • DecodableMixin.insert_code()
  • escapy.messages
    • MessageProvider
    • dict_message_provider()
escapy
  • Overview: module code

All modules for which code is available

  • escapy.commands
  • escapy.events
  • escapy.game
  • escapy.messages
  • escapy.mixins
  • escapy.objects
  • escapy.protocols.game
  • escapy.protocols.objects
  • escapy.protocols.ui
  • escapy.pygame.pygame_ui
  • escapy.types

© Copyright 2026, Matteo Zeccoli Marazzini.

Built with Sphinx using a theme provided by Read the Docs.