Skip to main content

A text based adventure game using Rich and Questionary

Project description

Advanced Generator Methods - Interactive Adventure Game

Overview for the task

This task demonstrates the use of advanced generator methods (send(), throw(), and close()) in a text-based adventure game. The player navigates through different stages by making decisions that influence the game's flow.

Game Flow

  • The player starts in a forest and chooses to go North or South.
  • Going North leads to a mountain, where they can enter a cave or go back.
  • Inside the cave, they find a treasure chest and can choose to open it (win) or leave.
  • Going South leads to a river, where they can swim (lose) or go back.

Modules

  • game_engine.py: Manages the main game loop and transitions between stages.
  • stage_logic.py: Contains generator functions for each stage (forest, mountain, river, cave).
  • main.py: Handles user interaction using questionary and rich for a styled CLI experience.
  • constants.py: Defines enums for Stage and Decision.

How to Play

  • Run the game and follow the prompts. Use the arrow keys to select your choices.
  • You can quit anytime by selecting Quit or pressing Ctrl + C.

To run the file

  • Navigate to:

    cd src
    
  • Then run using:

    python -m assignment_12.task_4.main
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gopika_adventure_game-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gopika_adventure_game-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file gopika_adventure_game-0.1.0.tar.gz.

File metadata

  • Download URL: gopika_adventure_game-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gopika_adventure_game-0.1.0.tar.gz
Algorithm Hash digest
SHA256 230eaef1cbde382ec74f298bc56bf379d1668d39937179edd99476ae58bf5ef0
MD5 5bce54b70e2f52e049239e6aaf0deaac
BLAKE2b-256 5b4f14fdb4d4ae70bacbdbc7d3374baa66260d102456b0b6e4b35c65e73790d1

See more details on using hashes here.

File details

Details for the file gopika_adventure_game-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gopika_adventure_game-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a00d9199eaebfc38024669a36c07e72037e076fc40ca98cf8b58b91456aebe53
MD5 d79905a10deb5eb6eca749298feb2aa7
BLAKE2b-256 e01bb516ba8df59db655e351257a644b54c493c20ce5ccf6c51d1735a7bac96c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page