playgen.io

Documentation

Player events

Events

Explanation of Events in the playgen.io Player

playgen.io offers various game events to help you understand player interactions and track engagement within each game. Below is an overview of each event type and its purpose:

  • PLAYGEN_SHARE_X: Triggered when a player shares their game progress or result across external platforms.

  • PLAYGEN_GAME_RESET: Occurs when a player chooses to reset their current game, restarting from the beginning.

  • PLAYGEN_GAME_OPEN_SHARE: Fired when the game’s share menu or share options are opened, indicating a player’s intent to share.

  • PLAYGEN_TOGGLE_THEME: Triggered when a player changes the game’s theme (e.g., switching between light and dark modes).

  • PLAYGEN_GAME_COMPLETED: Occurs when a player successfully completes a game, marking the end of gameplay.

  • PLAYGEN_OPEN_LEADERBOARD: Fired when a player opens the leaderboard, viewing other players' scores or positions.

  • PLAYGEN_SHARE_CLIPBOARD: Triggered when a player copies their game results or score to the clipboard for easy sharing.

  • PLAYGEN_OPEN_ARCHIVE: Occurs when a player accesses the archive to view past games or challenges.

  • PLAYGEN_TOGGLE_TIMER: Triggered when a player starts or stops the in-game timer, if available, to track their gameplay duration.

  • PLAYGEN_REQUEST_ARCHIVE: Used to request gated access to the game archive. This event can be used to control access to archived games.

  • PLAYGEN_TOGGLE_SOUND: Fired when a player toggles sound on or off within the game.

  • PLAYGEN_GAME_STARTED: Marks the start of a new game session, tracking when a player begins gameplay.

  • PLAYGEN_SHARE_FACEBOOK: Specific event for sharing the game result directly on Facebook.

  • PLAYGEN_GAME_OPEN_INSTRUCTIONS: Occurs when a player opens the instructions or tutorial for the game.

  • PLAYGEN_REQUEST_LEADERBOARD: Used to request gated access to the leaderboard. This can control who has permission to view leaderboard data.

Note on Request Events

The Request events (like PLAYGEN_REQUEST_ARCHIVE and PLAYGEN_REQUEST_LEADERBOARD) are particularly useful if you want to implement gated access to certain features. These events allow you to control access based on specific conditions or permissions, enhancing the flexibility of playgen.io’s integrations. Detailed documentation on gating features will follow in a separate section.

On this page