Python Text Adventure Game

In this assignment, students are tasked with designing a text-based adventure game (Links to an external site.). This game should utilize the Python essentials covered thus far, including, but not limited to:

 

Strings and String Manipulation

User-Defined Functions and Objects (variables)

User Input and Input Handling

Conditional and Nested Conditional Statements (if/elif/else)

Loops (for/while)

Controlling for Errors

The working version of the game should include:

 

An executable script (a script that runs from beginning to end upon execution) that includes:

a game that can be successfully completed within a maximum of 4 minutes

…a minimum of:

3 stages (maximum of 5 stages)

2 defined variables

1 loop

1 nested conditional statement

1 fail() function (executed whenever a user loses the game)

A docstring at the beginning of game that:

Is no more than 150 words

Introduces the game and its purpose

Identifies any bugs that are not yet worked out

Submission Requirements

 

A working version of your game in the following format:

Jupyter Notebook (.ipynb format)

Restrictions (advanced)

 

As this is the first coding course in the MSBA program, the following restrictions have been put in place to ensure our focus is on mastering the fundamentals of Python.

 

The only programming language you may use is Python (no JavaScript, C, or other languages allowed).

Global variables may be used, but must be static (avoid things such as combat engines and character attributes such as health and leveling up).

No use of class structures or other object-oriented programming structures (you must stick to user-defined functions).

You are not allowed to pass things between the stages of your game (stages should not inherit arguments from other stages, with the exception of static global variables). For example, a key found in Stage 1 cannot be carried forward to Stage 2.

__________________________________________________

 

Game Starter Code

 

__________________________________________________

 

Sample Games

 

The following sample games are likely to receive a B or C grade for this assignment. Each sample game meets the requirements as follows:

 

Sample 1: What Is Your Quest?

 

This sample game would likely receive a C grade as it meets the minimum requirements for the assignment.

 

Positive Aspects:

 

It functions properly and runs with the single click of a button

The docstring is in proper order

The story flows reasonably well and is entertaining for those that like Monty Python

The nested conditional and while loop are well placed

Error handling has been taken into consideration (although in this case it restricts user input)

Areas of Improvement:

 

The story is very simple and selection choices are predictable

It lacks replay value (there is not enough diversity in riddles, game flow is very linear, etc.)

The black_knight stage should have been given more depth

User input is quite restrictive for a text adventure game

Lacks dynamic content

The game follows the template too closely

Sample 2: The Ultimate Game Show

 

This sample game would likely receive a B grade as it meets the minimum requirements for the assignment.

 

Positive Aspects:

 

It functions properly and runs with the single click of a button

The docstring is in proper order

The story flows well and is entertaining for those that like structured game shows (simulated commercial breaks, etc.)

Global variables are used properly

Goes beyond the minimum requirements by utilizing more than one loop (although they are almost exactly the same)

User input is reasonably flexible, utilizing syntax such as in

Error handling has been taken into consideration

Good replay value (multiple random elements)

Dynamic content is utilized in a number of places

Areas of Improvement:

 

User input handling could have been improved with methods such as .lower() and structures such as try/except

User experience could have been improved with the use of methods like time.sleep()

Non-integer input in round_3( ) kicks users out of the game

error handling in round_3( ) could have been improved with the use of while True or try/except

Need a custom answer at your budget?

This assignment has been answered 5 times in private sessions.

© 2024 Codify Tutor. All rights reserved