Occluded Foresight - A Dungeon-Delving Python Terminal Game

Click here for a link to the game’s repository

Hi hi!

For this project I made a dungeon-delving terminal game called Occluded Foresight. This took me more than a week to make, but I very much had a fun experience making this. I’d be delighted to have your feedback on this :slight_smile:

In this game you navigate blindly through a crumbling crypt. Your objective is to collect all of the treasures inside it and find the portal to escape before the entire crypt collapses. Despite not being able to see anything, you will be guided by your character’s intuition to locate the treasures and escape (thus the name ‘Occluded Foresight’).

epic gaming montage 1 epic gaming montage 2 (winning)

The game’s code is subdivided into 6 parts:

  • Classes
  • Gridmaking
  • Obstacles and Treasure Generation
  • Character Presence & Movement Control
  • Game Initialization
  • Menu and Dialogs

Classes
This is where the Characters and Entities (Interactives) are created.

Gridmaking
This section handles the creation of the crypt itself. The crypt starts off as list form.
It only contains one function, generate_gridlist, which generates and returns the grid in list form.

Obstacles and Treasure Generation
This section handles the position of which each Interactives/Entities such as Pillars and Portals will be located inside the grid. It contains 5 functions:

call_all_air(gridlist):
randomselect_aircoords(gridlist,n):
addtreasuredetectors(gridlist,treasurecoords):
addportaldetectors(gridlist,treasurecoords):
treasurize(grid_list,tcl,tdl,pcl,portl,portdl):

Character Presence & Movement Control
This section is responsible for the existence of the characters and its movement. It has five functions:

change_charactercoords(x,y,movement_key):
isinsideWall(x,y):
generate_gridwithcharacter(x,y,generated_grid_list):
generate_gridwithalternate(x,y,generated_grid_list):
isinsideInteractive(x,y,generated_grid_list_, Interactive):

Game Initialization
This section is where all of the previous functions will be used. With the function initgl(), the crypt will be created and the game will start.

Main Menu and Dialog
With this last part of the code, all of the game’s dialogs are created.

So yeah, that’s pretty much a short summary behind the game’s code. Hopefully you enjoy it! Play with the code and whatever. Overall had fun making this.

Also credits to the website responsible for creating the ASCII Art of Occluded Foresight. Really epic.

1 Like