In this video, you will see a sample text-based game, similar to the one that you will design and code for Projects One and Two.
I will this homework assignment completed. Please try to refrain from copying from any of the online sources, as my professor checks. Please let me know if there is anything else needed from me
IT 140 Transcript for Sample Dragon Text Game Walkthrough
[00:00:06.03] Hello. In this video, you will see a sample text-based game, similar to the one that you will design and code for Projects One and Two. This sample game has a dragon theme, but you will choose your own theme for the game that you design. This video will help you understand how a text-based game works, and you'll get a chance to see the sample dragon text game in action.
[00:00:27.47] The text game involves a player entering commands to move to different rooms, or get different items. The goal of the game is for the player to get all of the items before they encounter the villain. For Project One, you'll be designing the text-based game. As a part of your design, you will be asked to create a storyboard, which includes a description of the theme, as well as a map. You will also be asked to create pseudocode or a flowchart to help you with the two major processes in the game—the process that allows the player to move between rooms and that allows the player to get items from different rooms.
[00:01:05.43] In Project Two, you will move beyond your designs and actually develop the code for the game. But before we get into that, let's first look at the sample storyboard for the game, which you can also find in the Project One Supporting Materials section.
[00:01:22.49] As you can see, there's a short paragraph that describes the theme of the game—in this case, the dragon theme. But again, you will be creating something on your own designs. And please choose something that you're interested in. Perhaps it could be space. It could be a spy theme. You could choose anything that has the idea of rooms, items, and a villain, so make sure to choose something that interests you. In this case, all of the different items and the rooms sort of fit with the dragon theme. It's sort of like you're in a castle, trying to navigate different items that you might need to defeat the villain.
[00:01:51.77] Once you've described the theme and the different items and rooms in your game, you want to lay them out in this map. And you've been given a blank map in either the Design Document or the Design Presentation Template, depending on which way you want to present your designs. And you can fill it in with all of the different rooms and items that go with your theme.
[00:02:11.85] So you can see here that all of the different rooms are laid out. And you can clearly see the item that's in each room. The great hall, or the start room, does not have an item in it. And the only other room that doesn't have an item is the dining room, which contains the villain—in this case, the dragon. You can see that this map also lays out the different directions, so that you can easily see how the rooms are connected to one another. This is going to be really helpful when you actually get to Project Two and start both developing and testing your code.
[00:02:43.07] Speaking of the code, let's open up PyCharm where I have some sample code. You'll notice that there is some actual code in here. Some of this has actually been given to you in [the] Project Two directions, as well, for you to use as a sample and a reference. But there's a lot of spaces where the code has been removed and just commented out. That was just for the purposes of this video.
[00:03:02.33] So we start with a couple of different functions. You can organize it in a different way, perhaps as part of one function. In this game, I've used two functions. The basic functionality, though, is that I want to tell the player the basic rules of the game. So in this case, it's that the player knows that they have to collect six items to win the game, or they will be eaten by the dragon. I have to be able to tell them the different commands that they can make, such as “go south,” “go north,” “go east,” “go west,” and “get” whatever the item is in the room that they're in, so that they can add it to the inventory.
[00:03:37.48] I also have this separate function here which, again, most of it is commented out. And it would show the current room of the player, their inventory, and the item that's in the room that they're currently in, if one exists.
[00:03:50.16] Next, the main gameplay actually takes place in the “main()” function. So you can see here, I have my “main()” function defined. And then I would have a section of code where I would define the inventory, which starts off as empty, because the player has not collected any items.
[00:04:05.92] Then I have a dictionary. And a sample version of this has also been included in the Project Two guidelines as well. Again, you will have to customize this, because it needs to fit the theme of your game. So you can see here that using your map that you did as a part of Project One will be really helpful when you develop the code for Project Two.
[00:04:23.08] You can see how all the rooms are linked together. So for example, from the great hall, if I were to go south, I would hit the bedroom. So you can see south, bedroom. You also want to make sure that you link the different items to the rooms. So for example, for the bedroom, the item in the bedroom is armor. And you can see that I've listed that as my last link in this dictionary. So it's important to make sure that you use your map to set this up properly.
[00:04:47.74] Next in my game, as part of the game play, I would start the player in the great hall, which is my start room. In your design, it might be different. I would have a call to show the player the game instructions. And then I have this while loop that will continue to handle the different commands from the player— so continue to prompt them for a command and then actually do whatever process is needed, based on whatever command that they enter.
[00:05:11.89] It's important that I have conditionals that help me exit the loop, once the player has either lost the game (for example, by encountering the dragon) or won the game by collecting all of the different items for the game. So make sure to include exit conditions for your while loop as well. You can see that I also have some decision branching that lays out what I should be doing if players type the “go” command or type the “get” command. And that's something that you'll be working on as well.
[00:05:40.25] So let me show you for a minute just how this code will actually run, so that you can see a little bit better how the game works. So I'm going to go to the actual solution, right-click, and click “Run.” And this is something that you definitely want to do when you're creating your own code, to make sure that it's working properly and that you've tested it.
[00:05:56.98] So you can see, as expected, when I start up the game, It prompts me. It tells me the directions of the game. It tells me the different commands that I can enter. It tells me where I am and the inventory. Then it prompts me to enter a move.
[00:06:09.10] So if I'm in the great hall—let's say I want to get the book—I can use my map to help me navigate and test the game. Again, remember, if somebody was actually playing this for real, they wouldn't have access to the map. That makes it a little bit more challenging for them. But since I'm developing the code and testing it, I want to actually have the map up, side by side, just to make it a little bit easier and to make my testing more efficient.
[00:06:30.52] So I'm going to try to type “go west.” And when I go west, I can see that I'm in the library. That means my game is working. It's moved me to the correct room. So next, I would get a book—the book, which the item in that room. And you can see that the book has now been added to my inventory.
[00:06:47.11] What happens if I type something that's not in there, like the shield? It should give me an error message. And you can see that it does. It tells me that I can't get the shield. So as you're developing your game, make sure that you use input validation, by including error messages and things like that for when the player types an improper command.
[00:07:06.88] So now, as I'm testing, normally I would test a bunch of different rooms, commands to go back and forth, collecting different items, just to make sure that it all works. I would also definitely want to test what happens if I tried to win the game and what would happen if I actually lost the game by not getting all of the items before I met the dragon. So for the sake of time, I'm just going to show you that option of what happens if I encounter the villain first.
[00:07:31.70] And you can see here that I'm in the library. So I want to get to the dining room. So using my handy dandy map, I can type—instead of “get east,” I want to type “go east.” And now, I'm in the great hall. I want to go east again. I'm in the kitchen. May as well get the sandwich while I'm in there. And then if I go north, I should encounter the dragon, which I did.
[00:07:54.91] You can see that the game tells me that I saw a dragon. “Nom, nom, game over.” And it's actually exited the game, and the game is now over. And it gives me a little message to let me know that.
[00:08:04.90] So that's the basics of how a text-based game works. So I hope that helps you understand it a little bit better and gives you an idea of what you will be designing as part of Project One and also developing code for as a part of Project Two.
1
,
1
IT 140 Sample Dragon Text Game Storyboard The dragon has taken over the dining room and your party guests will arrive in a matter of hours. You need to defeat the dragon before your guests arrive, but before you fight the dragon you will need a few items. You will need a book from the library to learn how to defeat the dragon, armor from the bedroom to protect your body, a helmet from the cellar to protect your head, a sword from the dungeon to stab the dragon, a shield from the gallery to protect yourself from the dragon’s fire, and finally a peanut butter sandwich from the kitchen to gather enough energy to defeat the dragon. Here is a map of the castle rooms and items to help navigate your quest: Gallery
Item: Shield Dungeon
Item: Sword
Dining Room
Dragon!
Kitchen
Item: Sword
Cellar
Item: Helmet
Library
Item: Book
Bedroom
Item: Armor
Great Hall
North
North
North
South
South
South
East
East
East
East
West
West
West
West
- IT 140 Sample Dragon Text Game Storyboard
,
IT 140 Design Document Template
Instructions
Fill out the sections below. Be sure to remove the bracketed text before submitting your Design Document.
[Insert Your Name Here]
Storyboard (Description and Map)
[Include a paragraph description of your theme, storyline, rooms, items, and villain here. Be sure to also complete the map below with your rooms and items. You may add more rooms and directions if you like. Use the Insert menu and select Shapes to add textboxes and arrows.]
East
North
West
East
South
West
East
South
North
West
East
North
South
West
Pseudocode or Flowchart for Code to “Move Between Rooms”
[Write pseudocode or create/insert your flowchart here.]
Pseudocode or Flowchart for Code to “Get an Item”
[Write pseudocode or create/insert your flowchart here.]
1
,
IT 140 Design Presentation Template
[Instructions: Fill out the sections in the following slides. Be sure to remove the bracketed text before submitting your Design Presentation.]
[Insert Your Name Here]
Storyboard: Description
[Include a paragraph description of your theme, storyline, rooms, items, and villain.]
Storyboard: Map
[Complete this map with your rooms and items. You may add more rooms and directions if you like. Use the Insert menu and select Shapes to add textboxes and arrows.]
North
North
North
South
South
South
East
East
East
East
West
West
West
West
Pseudocode or Flowchart: Move Between Rooms
[Write pseudocode or create/insert your flowchart here.]
Pseudocode or Flowchart: Get an Item
[Write pseudocode or create/insert your flowchart here.]
,
1
IT 140 Sample Dragon Text Game Output Overview In Projects One and Two, you will be designing and then developing a text-based game with a theme of your choice. This handout shows input and output from the sample Dragon Text Game. This will help give you an understanding of how a text-based game works. In this dragon-themed game, the player is trying to find all the items (book, armor, helmet, sword, shield, and peanut butter sandwich) before running into the villain (the dragon). You can also see a sample execution of this game in the Sample Dragon Text Game Walkthrough, which is located in the Supporting Materials sections of the projects. Sample Output Below is sample output of the program, with the player’s input shown in bold font. You will see examples of the game’s output in response to different commands such as moving between rooms or getting items. You will also see examples of input validation, or how the game responds to invalid commands such as getting an item that is not in the current room, moving in a direction that is not valid, or entering a command in the wrong format. As a reminder, the output here is just a sample. The output for your game does not have to exactly match what is here. Dragon Text Adventure Game Collect 6 items to win the game, or be eaten by the dragon. Move commands: go South, go North, go East, go West Add to Inventory: get 'item name' You are in the Great Hall Inventory : [] ————————— Enter your move: go North You are in the Dungeon Inventory : [] You see a Sword ————————— Enter your move: get Sword Sword retrieved! You are in the Dungeon Inventory : ['Sword'] ————————— Enter your move: get Shield Can’t get Shield! You are in the Dungeon Inventory : ['Sword'] ————————— Enter your move:
2
go South You are in the Great Hall Inventory : ['Sword'] ————————— Enter your move: go East You are in the Kitchen Inventory : ['Sword'] You see a Sandwich ————————— Enter your move: Sandwich Invalid Input! You are in the Kitchen Inventory : ['Sword'] You see a Sandwich ————————— Enter your move: get Sandwich Sandwich retrieved! You are in the Kitchen Inventory : ['Sword', 'Sandwich'] ————————— Enter your move: go South You can’t go that way! You are in the Kitchen Inventory : ['Sword', 'Sandwich'] ————————— Enter your move: go North You are in the Dining Room Inventory : ['Sword', 'Sandwich'] You see a Dragon NOM NOM…GAME OVER! Thanks for playing the game. Hope you enjoyed it.
- IT 140 Sample Dragon Text Game Output
- Overview
- Sample Output
,
1
IT 140 A Mini History of Text-Based Games Text-based games were the predecessor to the reality-based video games we play today. They were "interactive fiction" where words came to life as players read text and made decisions about what to do. These text-based games simulated environments where players used text commands to control their characters and influence the gaming environment. Imagine a current action-adventure video game where, instead of using a controller or touchscreen to give your character directions, you enter text on a command line. There are no graphics on the screen, forcing you to use your imagination. Commands you enter might be “open door”, “go west”, or “fight troll”. These commands change the way the story plays out. While it may be hard to imagine a video game without any videos, these text games were very popular in the 70s and 80s. Many programmers and computer technicians played role-playing board games, like Dungeons and Dragons, with their friends. A text-based game allowed them to take their adventures to the digital realm. They could play their games on the mainframes at work, submitting commands with a teleprinter and receiving the output on paper.
T100S Teleprinter by Jens Ohlig under CC BY-SA 2.0
2
Eventually, monochrome monitors allowed players to see their input and output in real time, right before their eyes. Players were able to enjoy playing Lunar Lander and Star Trek using displays like the following:
GT40 Lunar Lander by Brouhaha under CC BY-SA 3.0
Star Trek Text Game by James Gibbon under CC BY-SA 3.0
You can still find playable versions of these games online, such as Lunar Lander, Star Trek, and Zork. They will help you see how far game development has come. (Note: Links may change over time. Search for the game name and “simulator”.) In this class, you will have the opportunity to create your own version of a text-based game. You will be able to see your code come to life as it becomes interactive. Through the use of conditionals and loops, you will be able to guide adventurers through your world in the same way these early text-based games did several decades ago.
3
References
McIntosh, J. (2018, July 20). A brief history of text-based games and open source. Opensource.com.
https://opensource.com/article/18/7/interactive-fiction-tools
Rileym65 (GitHub username). (n.d.). Lunar mission simulator. Lunar Mission Simulator.
https://www.lunarmissionsimulator.com/index.html
Star Trek text game (Video game). (n.d.). TV Tropes.
https://tvtropes.org/pmwiki/pmwiki.php/VideoGame/StarTrekTextGame
- IT 140 A Mini History of Text-Based Games
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
