Skip to content

Marjuk44/Project-Text-Based-Game-EscapeRoom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project-Text-Based-Game-EscapeRoom

The mission is to code a text-based game - "Escape Room" in python. Implement Python code, manage errors, and test the game to ensure robustness. Each room presents unique challenges. The goal is to escape from the starting room (Game Room) to the end (Outside). The image below and the game narrative helps to understand the game logic completely:

image

Game Narrative

Suddenly, you find yourself waking up on an unfamiliar couch, in an eerie house devoid of windows. Your memory fails to provide any explanation about how you ended up here, or what transpired previously. You can sense an imminent threat lurking somewhere - your gut tells you to escape the house immediately!

You look around and realize you’re in a game room.

“What should I do?” you ponder.

You decide to explore the room, which uncovers a couch, a piano, and a locked Door A. The couch appears mundane and unexciting. However, examining the piano rewards you with a key for Door A. With the newfound key, you manage to unlock Door A.

Will you step into the unknown through Door A?

Bedroom 1

You step into Bedroom 1.

Again, you find yourself contemplating - to explore or examine?

Your exploration reveals a queen bed, Doors A, B, and C. Underneath the queen bed, you find a key for Door B. Door C remains an impenetrable barrier as it’s locked and you lack the key. But with the key you found under the bed, you manage to unlock Door B.

Is it time to venture through Door B?

Bedroom 2

Your journey leads you to Bedroom 2.

“What now?” you think.

A thorough exploration uncovers a double bed, a dresser, and Door B. Hidden in the double bed, you discover a key for Door C, and within the dresser, a key for Door D awaits. Equipped with the key for Door B, you decide to unlock it.

Shall you retrace your steps through Door B?

Bedroom 1

Once again, you find yourself in Bedroom 1.

“What’s the next move?” you wonder.

With the key for Door C in your possession, you manage to unlock it.

Are you ready to brave the unknown behind Door C?

Living Room

Stepping through Door C, you find yourself in the living room.

“What secrets does this room hold?” you muse.

Exploration reveals a dining table, Door C, and Door D. With the key for Door D in your grasp, you unlock it.

Is it time to step through Door D and see what lies beyond?

Outside

Freedom! You’ve managed to escape the room! Congrats on your successful adventure! Now, can you recount the thrilling journey and the clever strategy that got you here?

Making The Game

  • The game incorporates various data structures, specifically dictionaries and lists, to define game rooms, paths, and items.
  • The game uses a Python dictionary to store the game state which is updated when progress is made, such as a key being collected.
  • Flow control (if, elif, else statements) has been utilized to create game logic, for example, to determine what happens when a player makes certain choices or interacts with game items.
  • The code appropriately uses loops where needed, such as for repeating game actions until the player reaches a certain outcome.
  • The game uses functions to play the game and compartmentalize tasks such as navigating between rooms or interacting with items.
  • Arguments are used in functions where appropriate to allow for reusability.
  • The game uses return statements in functions to output certain results.
  • After completing each game action, functions are called to continue playing until the winning condition is reached.
  • The game utilizes comprehension for creating more efficient and readable code where applicable.
  • Any user input is validated and the game incorporates error handling techniques to handle any possible errors or exceptions, providing a smoother user experience.
  • The code is well-documented with comments explaining what different sections of the code are doing. Functions are properly documented as well following docstring good practices.
  • The game has a clear end goal or “win” condition that the player can achieve (making it “Outside”).

About

The project is to code a text-based game, "Escape Room" in python. Control the flow (if, elif, else statements) to create game logic.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors