Skip to content
Himank Deka edited this page Apr 5, 2024 · 12 revisions

Welcome to PyTextGame

PyTextGame is a text-based game development library which can be used to make console-based games. This package is available both on GitHub and on PyPi.

Documentation

  1. The Playground class in pytextgame.core is the main class. It is used for managing your game. It has 3 functions - importData used to import the saved game state [Parameters: msg: bool used for hiding or showing logs], saveData used for saving game state [Parameters: data dictionary containing game information, msg:bool same as importData], and play used for starting the game [Parameters: playerhttps://github.com/dev-hd11/pytextgame/wiki/Home/_history instance of the Player class. while initializing you need to provide it - the path to the JSON file used for storing data, the map of the game which is a list containing the objects of Room class in any dimension, and set whether the target platform is Windows.

  2. The pytextgame.io module contains 2 methods for taking input - optionList: shows a list of options and inputs a choice [Parameters: option_list], and getch used for taking a character as input.

  3. The Room class in the pytextgame.components.rooms is used for creating a room. A 'room' is a particular environment for a stage or a scene of your game.

Documentation will be continued...

Current status

The latest stable version, v1 is available on PyPi.
We reccommend to download using pip.

  • By Himank Deka.
Clone this wiki locally