Game Plugin

The Game plugin extends the base Game class with game-specific functionality.

Plugin Package Structure

A Game plugin package contains:

  • Plugin definition file

  • Game-specific Game subclass

  • Game-specific GameAPI subclass

  • Game sprites

Game Subclass Implementation

Most critical functionality comes from the parent Game class. The subclass provides game-specific configuration.

Required Components

class BluetangMyGame(Game, metaclass=Singleton):
    def __init__(self, **kwargs):
        kwargs["platform"] = "steam"
        kwargs["window_name"] = "My Game"
        kwargs["app_id"] = "123456"
        
        super().__init__(**kwargs)
        
        self.api_class = MyGameAPI
        self.api_instance = None

Screen Regions

Define regions of interest:

OCR Presets

Configure text recognition settings:

GameAPI Implementation

The GameAPI subclass contains reusable game-specific functions in files/api/api.py

Function Categories

  • UI operations

  • Game state management

  • Sprite detection

  • Data processing

Namespacing

Game Sprites

Directory Structure

Place sprites in files/data/sprites using PNG format.

Naming Convention

Examples: * `sprite_npc_priest_0.png` β†’ SPRITE_NPC_PRIEST * `sprite_npc_priest_1.png` β†’ Additional frame for SPRITE_NPC_PRIEST

Last updated