AcademiaAgriculture & FarmingHumanitiesSocial SciencesSTEM

Creating a Game With Notepad

Updated on April 29, 2016
You probably won't know what all of this means right now, but I'll explain it soon.
You probably won't know what all of this means right now, but I'll explain it soon.

Introduction

Did you know that the simple Notepad program on your computer is actually a very powerful programming tool? That's right, and it is also very easy to learn. In this article I'm going to show you how to make a simple game using only the Notepad program and a programming language called "Batch."

Batch is a language that runs primarily out of your Windows command prompt. Now, it's not even close to being the most powerful programming language out there, but it still let's you do enough to be extremely useful to know (at least for anyone in the computer field).

Not only is it useful, but it can also be used to create amazing text-based games! What is a text-based game you ask? It's a game (a very simple one) in which the user interacts through the use of text and choice-making.You will learn how to set up situations in which the characters will have to make choices about how they want to approach the problem.

A Few Quick Reminders

I want to go over a few quick things before we get in to the actual code. The first thing is that all of your commands should be kept on separate lines. So after you type something in, and are done with what is going to be on that line, hit the "enter" button on your keyboard to move to the next line.

The second thing I want to mention is that batch files read from top to bottom. This means that when you run a batch file, all of your code at the top will be interpreted and will run before your code at the bottom. This concept is what allows some of the things I'm going to teach you, to work. If for example you place a "echo" command and in the next line place a "cls" command, all of your text will be erased without your player getting to read it (this will make more sense later on).

If you ever have a problem and your game isn't working correctly, make sure you go back and ensure that you haven't made any of these errors.

Starting Up Notepad

Let's start by opening up Notepad:

Click on your start menu icon and go to "All Programs." A list of all the programs on your computer should appear, along with a file called "Accessories." Go in to the accessories folder and you should find Notepad, click on it to begin.

You should find Notepad in the Accessories folder.
You should find Notepad in the Accessories folder.

Code!

Now you're ready to begin typing your first lines of code, as well as learning you first commands. Commands are each of the words that we type in to the program that have a function; such as the echo, or pause commands.

@echo off, echo, echo. and pause

The first commands I'm going to teach you are very simple, however, they play an important part in the coding process (especially if you're making a game!).

@echo off - This command is used to remove all of the unnecessary text that can interfere with your game. It should always be added first; once it is added to a file, it does not have to be typed in again.

echo - echo is used to display regular text in your game. For example you can type: "echo Hello adventurer!", and the people playing your game will see is "Hello adventurer!" (So long as you typed in @echo off).

echo. - echo. (with a period) is used to create a blank line in your game. This can be useful in keeping your text uncluttered.

pause - This command is used when you want your players to take a break, and is used most often when you want to give them time to read some text. When you use this code it shows up as "Press any key to continue . . ." Your players can then press any key, when they are ready, in order to continue playing.

This is what your game should look like. Notice the long spaces between the text? This was done with the "echo." command. Also, note the pause command at work toward the bottom.
This is what your game should look like. Notice the long spaces between the text? This was done with the "echo." command. Also, note the pause command at work toward the bottom.
This is what your game should NOT look this. When you don't add "@echo off" this is what happens.
This is what your game should NOT look this. When you don't add "@echo off" this is what happens.
color 71 and "My Game" in the title bar.
color 71 and "My Game" in the title bar.

cls, exit, title, and color

Ok, this next set of commands are all really simple as well, but are nice to have.

cls - cls is a command that I use a lot. It stands for "clear screen", and what it does is remove all of the text that has been made in the command prompt window (ergo, making the screen blank). This is a good tool when you want to keep your game looking clean and in order.

exit - This does exactly what it sounds like, it closes the game. You should only use this when the characters reach the end of the game, or if you want the game to close when they die or make a wrong decision.

title - title displays whatever you type after it in the title bar of the command prompt window.

color - color is a really fun command, and can be used to liven up your game. When you add the color code, followed by a space and a specific set of numbers or letter, you can change the colors of the command prompt window. For a list of the available colors see the picture below or open up the command prompt and type in "color/?".

You can access the command prompt by going back in to the accessories folder in the start menu. It should be in the same list as Notepad.

This is what you will get if you type "color/?" in to the command prompt.
This is what you will get if you type "color/?" in to the command prompt.
This is about what you should be capable of doing at this point.
This is about what you should be capable of doing at this point.

Let's Take A Break

Let's stop for a second and look at what we have so far. I've shown you several basic commands, and have taught you how to use them. Remember that each command should go on a different line (so hit "enter" after you finish with each command). Take a look at the picture to the right, so that way you can be sure that you know about what your file should look like.

goto

The "goto" command is simple, once you get to know it. The command is used when you want a player to jump to a different section of your game, such as when they make a certain decision.

It works this way:

You enter the "goto" command on a separate line, or at the end of an "if" statement (which we will go over later). You then specify a variable which will become the name of the destination. The name can be anything you want, and consists of the word(s) you type after "goto".

To specify your destination:

Move to a new line of code, directly above where you want your player to start. Type a colon ':' followed by the name of the destination.

example of a goto command.
example of a goto command.

set /p and if

These commands are the most advanced commands that I am going to teach you. They both have to be set up a specific way and also work with several other, smaller commands in order to function correctly.

set /p variable= - This command is used when you want your player to insert a variable (a varying answer). This could be anywhere from their name to the name of a weapon or even the answer to one of the choices you have given them. Often times this variable will be referenced later, and therefore must be given a name. The name can be whatever you want it to be (but remember that you may be typing it in a lot when making your game). I think it would be easiest if I gave you some pictures showing you how to create variables.

set /p name=
set /p name=

See how I use the "echo" command to ask my player what his name is? I then go ahead and type:

set /p name=

This is where my player will type his name. "name" In this line is my variable. In a sense what we are doing is setting (set) a variable (name) to equal (=) whatever the user types.

We can reference this variable later by placing the name of the variable within two of the '%' symbols. For example:

echo Hello %name%, my name is Tom.

This will feed whatever the player typed in, back to him in the form of text.

Here is what happens when a player types in his name, then you feed that name back to him with the echo command.
Here is what happens when a player types in his name, then you feed that name back to him with the echo command.

if - this command is used when we create if/then statements. We can use it in conjunction with "set /p" in order to create choices for are players.

  1. Ask the player a question with the "echo" command. Make sure to clearly state their options.
  2. Give them the ability to enter an answer with the "set /p" command.
  3. Create "if" statements that allow the players' choices to have consequences, and that allow the story to continue.

"if" statements are used with "equ" and "neq" which mean "equals" and "doesn't equal", respectively.

This is how your statements should look:

:start

echo YES or NO?

set /p variable=

if %variable% equ YES goto situation1

if %variable% equ NO goto situation2

if %variable neq YES goto start

All of this code means that if the player types in "YES" he will be sent to "situation1"; if he types in "NO" he will be sent to "situation2"; if he types in neither "YES" or "NO" he will be sent back to the start of the question.

Remember when I said earlier that the order you write your code matters? If you typed in the "neq YES" code before the "equ NO" code, your player would never be able to make it to "situation 2".

Here is a good example of how you can use "set /p", "goto", and "if" all together.
Here is a good example of how you can use "set /p", "goto", and "if" all together.

Saving

The last thing I need to show you how to do is to save your file. Once you are all done, click the "file" button at the top of the screen, then click on "Save As." This will display a window where you can then create a name for you game and save it wherever you would like. However, you need to make sure that you save it as a Batch (.bat) file and not as a regular text file (.txt).

To do this, after you type in the name of your game add .bat behind it. You then need to go to "Save as type" and select "All Files."

Then you're done! All you have to do is hit the "save" button.

Remember, you can edit your game at any time by right clicking on the batch file and selecting "edit."

Select "All Files", then click the save button to finish.
Select "All Files", then click the save button to finish.

Conclusion

It's as easy as that! With only the few short commands that I taught you (@echo off, echo, cls, pause, color, goto, etc.) you can be on your way to making very large and complex text-based games. Always double check your code to make sure that you typed everything correctly, and if you have any questions feel free to leave a comment and I'll get back to you as soon as I can. Good luck and have fun!

Comments

    0 of 8192 characters used
    Post Comment

    • Claudia47 profile image

      Claudia47 4 years ago from Boynton Beach, Florida

      Very cool. Notepad has always been my go-to note application - now I can create a game next time I'm bored. (The great thing is that virtually all Windows computers have notepad...). Thanks.

    • aking21 profile image
      Author

      Alexander King 4 years ago

      No problem. If you want you can also look up the program "Notepad++". It's free and can make things a little bit easier by color coding everything.

    • pinappu profile image

      pinappu 4 years ago from India

      Hey aking21 congratulations for being hub of the day.

    • profile image

      ignugent17 4 years ago

      Congratulations hub of the day!

    • Cherry4 profile image

      Cherry Ann 4 years ago from New York

      Thanks for sharing.

    • RTalloni profile image

      RTalloni 4 years ago from the short journey

      Interesting…thanks, and congrats on your hub of the day.

    • nancynurse profile image

      Nancy McClintock 4 years ago from Southeast USA

      Great hub. We should all use this tool more often. Thanks and congratulations on hub of the day. You obviously worked so hard. Very interesting. Voted up.

    • Relationshipc profile image

      Kari 4 years ago from Alberta, Canada

      I had no clue you could do anything with notepad besides write plain text. This is seriously cool. The first thing I thought of is creating a game for my husband for his birthday. That will be something I have never gave him! Great hub, and you deserve the hub of day!

    • BriMaureen profile image

      Brianna Clark 4 years ago from Murfreesboro, TN

      This is so awesome! Thanks for posting! Posted it on my Facebook!

    • Daniel Roo profile image

      Daniel Roo 4 years ago from Southern England (United Kingdom)

      I created my first website by coding in Notepad that is bundled with WindowsOS, it's a powerful tool but very easy to screw up the code. One little error and the rest of the code won't be read correctly. Good fun for those who like a challenge.

      Congrats on explaining complex code clearly. Great hub, deserves Hub of the Day.

    • Millionaire Tips profile image

      Shasta Matova 4 years ago from USA

      This is really interesting. I didn't know about Batch. I have played around a bit with Basic, Cobol, Fortran (do those date me?) and HTML. It will be interesting to try a different one.

    • StephanieBCrosby profile image

      Stephanie Bradberry 4 years ago from New Jersey

      Wow. I really did not know that Notepad could do this much. I know my husband uses Notepad for coding for websites, but he never said anything about being able to create a whole game. This is really cool. Thanks so much for sharing this. This was a well deserved Hub of the Day. You explain everything so well and clear enough for people with no coding experience to follow along. When I have free time I am going to try my hand at this.

    • allelsematters profile image

      Lady Jen Palven 4 years ago from Philippines

      Cool! I didn't know we could program on a notepad.

    • NornsMercy profile image

      Chace 4 years ago from Charlotte, NC

      Congratulations on HotD! This seems like something even scatterbrained I could do... I've only ever written tiny programs with Python. Voted up and across! :)

    • jpcmc profile image

      JP Carlos 4 years ago from Quezon CIty, Phlippines

      This looks fun. I've never tried something like this before. Thanks for sharing. I'm sure many will enjoy this.

    • mosaicman profile image

      mosaicman 4 years ago from Tampa Bay, Fl

      I feel like making a game right now. Great hub.

    • jacharless profile image

      Charles James 4 years ago from Between New York and London

      Great job, Alex. I haven't seen a .bat file in years. Brought back memories. Also, congrats on the Rising Star -and on switching to Apple. Best of writing on Hub Pages!

    • profile image

      Akash methani 4 years ago

      I like software And games to so this site is best for me ...........

      This web site is amazing...............

    • myyoga profile image

      Pratama Yoga Saputra 4 years ago

      Thanks for sharing, I'm happy to get this great information. I will try in my computer... Thanks you... :)

    • Anonymous00 profile image

      Anonymous00 4 years ago

      Very nice work. +1

    • profile image

      dhruvin 4 years ago

      yo cool

    • cerefo profile image

      Real Name 4 years ago from India

      Nice Programming Keep up!

    • profile image

      movingfinger 4 years ago

      Cool hub and nice program.. keep them coming.. and Congrats for being hub of the day.. this article proves that Content is King.. !!

    • livewirez profile image

      Romel Tarroza 4 years ago from Pearl of the Orient Sea

      This is cool. No wonder this was chosen as hub of the day.. Keep up the good work man...

    • profile image

      Jeff_H 4 years ago

      This is cool and interesting! I am interested to know more on this subject.

    • profile image

      wow 4 years ago

      awesome

    • profile image

      winnie33 4 years ago

      awesome! you have also explained everything very good!

    • profile image

      Mr. me 4 years ago

      How do you upload notepad programming along with graphics, sound, and multiple non-level areas?

    • aking21 profile image
      Author

      Alexander King 4 years ago

      As far as graphics you will have to use the "echo" command along with the symbols on your keyboard and any ascii symbols. You basically have to make pictures out of letters, numbers, and symbols.

      For sound, I've never tried this but you can try the "start" command along with the name of your sound clip. Ex: "start c:\sounds\my_sound.mp3"

      Also, I'm not quite sure what you mean by "non-level areas".

    • profile image

      Brad 4 years ago

      hey i have made my own small text game using this guide and it's for a series of games like this i have previously made, but when you get to the final choice it just closes the window. can someone help me out about where i may have gone wrong with the commands, here are the commands I used to make the path...

      :good

      cls

      echo.

      echo That's very good %name%, excellent work. however there is one more test you must pass....

      echo.

      pause

      cls

      echo.

      echo You must take this firearm and shoot the man with the bag on his head....

      echo.

      pause

      cls

      echo.

      echo *shoot man*, *shoot interigator* or *take off bag on man's head*

      echo.

      set /p where=

      echo.

      if %where% equ *shoot man* goto done

      if %where% equ *shoot interigator* goto nice

      if %where% equ *take off bag on man's head* goto incorrect

      if %where% neq *shoot man* goto good

      can anyone see any problems i may have missed??

    • profile image

      KingGyro 4 years ago

      you can also make non-text based games though it is much harder and annoying. i'm working on one that you find a treasure in a room and avoid hidden traps and enemys its muchness annoying.

    • profile image

      sadhak 4 years ago

      not good but not bad

    • mymode profile image

      mymode 4 years ago

      Excellent! I'm gonna do this once I got home. Thanks bro!

    • profile image

      ashishkirodian 4 years ago

      superb bro!!!i never knew the power of notepad..now i learnt a few from the site..thank u

    • profile image

      needtoknow 4 years ago

      After I save the file, how do I open it to play?

    • profile image

      niffertepig 4 years ago

      @Brad

      delete the last .echo for it to work, or you are separating set /p from the if.

      After you put more in the end, it should work properly.

    • profile image

      shirleetemple 4 years ago

      Just a question: After players type something in, do they hit enter? Because when I do, it exits the game.

    • profile image

      IAmConfused 4 years ago

      When I create a choice, I can't make any of the answers have two or more words?? When I play and write in two words as an answer, the game quits even though it's a right answer! Why??

    • profile image

      aaa 4 years ago

      nice

    • epbooks profile image

      Elizabeth Parker 3 years ago from Las Vegas, NV

      Very good hub! I haven't programmed in a while, but used to know Visual Basic. Before that and back in the day, the Commodore 64. It used to take forever on the commodore just to make a screen change color! Voted up!

    • receivetipstricks profile image

      Mrinal Saha 3 years ago from Jaipur,India

      cool thanks ,,

    • profile image

      Hacker101 3 years ago

      Hi people.Notepad is a very good program.Can anyone please tell me some good notepad tricks? Thanks a lot.Awesome site!!!

    • profile image

      david 3 years ago

      i can't get the game to "start"

    • aking21 profile image
      Author

      Alexander King 3 years ago

      After saving the file as a ".bat" you just need to double click on the program in order to get it to run.

    • profile image

      SNSSDS GAMER 3 years ago

      what to do after typing commands on notepad? Please sir make it clear to me that how the scenes and audio of the will be added? How a setup of the game will be created after all of these? Will it be a powerful game like igi 2 ? How to add the character's pictures into the game? How to know how much situations i will have to make in the game according to scenes? will the scene be a simple photograph or a videography?

    • profile image

      kalesha 3 years ago

      superb!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    • profile image

      How You Add Pictures, Videos, Sound? 3 years ago

      Please Explain?

    • profile image

      shankar 3 years ago

      oh that's good it is work

    • profile image

      Tibe 3 years ago

      I just found this and started off tinkering with it an I caught on real fast. However. I can't find anything anywhere, an was hoping towards the end of this post, about how to make it so the player can save their game and then load the game from that saved spot.

    • profile image

      zapak 3 years ago

      brothers and there sisters i have made a non text adventurous game with notepad you can have its code

    • cnblogs profile image

      cnblogs 3 years ago

      wo o .notepad .very cool.

    • AvineshP profile image

      Avinesh Prahladi 3 years ago from Chandigarh

      Hey aking21, I wasn't aware that a game can be formulated with the help of notepad. Quite amazing, I must say :-)

    • profile image

      deep sharma 3 years ago

      how to create a game throught noteped. and which hub auther gives.. pls reply me...

    • phtech profile image

      Skyler Parker 3 years ago from Idaho Falls, ID

      Good job. It's been a while since I've seen a .bat game. Thanks.

    • profile image

      ameer media 3 years ago

      good game

    • profile image

      CreativeJM 3 years ago

      Question, I got a few problems but I just want to start off with this one. When I was making mine, it didn't seem to work out properly. (It exits even though I think there was nothing wrong with the code) When I was suddenly making a guess of why it didn't work, I tried to solve it and it somehow worked. The problem? I don't think that it can handle "special characters" but it worked out with other special characters like "!" and "-".

      So while I'm working on other problems, I'm hoping that I can get a solution for this one.

      Thanks for reading.

    • profile image

      kim 3 years ago

      this is the best ever

    • redfive profile image

      Levy Tate 3 years ago from California, USA

      I could give you a lot of reasons why I gave up on coding, but this looks fun, so I really wouldn't mind giving it another shot. Thanks for sharing, pal! Voted up :)

    • profile image

      MRIDUL 3 years ago

      I really like this site.And codes also

    • profile image

      Eren 3 years ago

      This really helped me

    • profile image

      HERO 3 years ago

      THANX FOR THE INFO DUDE

      YOU ARE THE BEST

      DIDN'T KNW IT WAS GOOD

    • profile image

      Dion 3 years ago

      need full idea of creating game an software manually using notepad or word sheet and i need ur private chatting site so that i can learn more from you

    • profile image

      Marriane 3 years ago

      You are the best among the rest! Among the rest you are the best! Thanks a lot and a lot and a looooooottttt! I really reaaaaally want to thank youuuu! ^_______________^

    • profile image

      Zachariah 3 years ago

      Please can I view my program on webpage? If yes how?

    • profile image

      Zachariah 3 years ago

      How do I make a webpage to make decision like on batch?

    • profile image

      Aafreen 3 years ago

      very cool..its interesting..

      keep it up..

      update this using new and advanced commands..

      it'll be very helpful to all.. u r great..THANK YOUUUUUUUUUUUUUUUUU SOOOOOOOOOOOOOOOOO MUCHHHHHHHHHHHHHHHHHHHHHH............

    • profile image

      bfilipek 3 years ago

      Cool idea. I did not know that with only bash/cmd you can do such things. Probably even more could be created using PowerShell scripts. Do you is PowerShell as well ?

    • Thief12 profile image

      Thief12 3 years ago from Puerto Rico

      When I was in college, we used to play two "batch" games all the time. Nibbles and Gorillas XD The good ole' days.

    • profile image

      abhash rai 3 years ago

      How can I make a graphic game?

      Can I make a graphic game with notepad or c++???

      If yes , then how??

    • profile image

      bfilipek 3 years ago

    • profile image

      Joseph 3 years ago

      I just created my own text game! thank you so much for your help

    • profile image

      Amideous 3 years ago

      Thanks a thousand times... I just created mine too.

    • JamesWhitaker profile image

      James N. Whitaker 2 years ago from Dallas, Texas

      This is cool. I am gonna try to create my own too. Let's see how it goes.

    • profile image

      nate 2 years ago

      at the end of mine here when i go to to say sleep in longer or the the other it just closes and says (set unexpected)

      echo off

      color 34

      :start

      cls

      title The Dead May Follow

      echo.

      echo hello

      echo.

      echo what is your name.

      echo.

      set /p name=

      echo.

      echo hello %name% im Nathan.

      echo.

      echo lets start.

      echo.

      echo you wake up in bed after finding out the night before your mother has died.

      echo.

      echo do you get dressed and go downstairs or do you sleep in longer.

      echo.

      set /p you=

      echo.

      if %you% equ get dressed and go downstairs goto get dressed and go downstairs

      if %you% equ sleep longer goto sleep longer

      if %you% neq sleep longer goto start

      if %you% neq get dressed and go downstairs goto start

      :get dressed and go downstairs

      cls

      echo.

      echo your the only one home

      echo.

      pause

      :sleep longer

      cls

      echo.

      echo you wake up its 11 o clock and nobody is home

      pause

      exit

    • Ahsam Ali profile image

      Ahsam Ali 2 years ago

      intressting

    • profile image

      Hemangi 2 years ago

      Its awesome......

    • profile image

      Confused 2 years ago

      I can't get the option thing to work. Is there some kind of trick to it?

    • profile image

      Peter Blomquist 2 years ago

      I have everything written down in notepad, but how do I get that into command prompt?

    • profile image

      deep 2 years ago

      thank you guy!

    • profile image

      anonymous 2 years ago

      Whenever i try making a game it just exits when.i get to the player typing something

    • profile image

      iain 2 years ago

      thanks but how can you make it to where the player can save their progress

    • profile image

      jawz8300 2 years ago

      so cool, thanks man

    • profile image

      Adwyetya 2 years ago

      When I run the game, and type something it just exists.

    • profile image

      Peter 2 years ago

      @Adwyrtya that's because u gotta make sure to write pause; every class example: @echo off

      Title (title)

      Color (number)

      echo Welcome to this game

      echo what is 1+1

      echo.

      echo type 1 and enter to proceed

      set /p input=Enter Value:

      If %input%==1 goto game1

      if %input%==2 exit

      pause;

      so "pause;" is gonna be end of a class then it wont exit

    • profile image

      sun 2 years ago

      make money

    • profile image

      okfdopgks#[pkg 2 years ago

      Peter that wont work because you put exit so when they put 2 it will exit and nothing can stop it from closing down

    • profile image

      ujjwal (virus maker) 2 years ago

      This is great. But can we save the game with .exe extension? Is there is any problem to open when I save with .exe?

    • profile image

      ba 2 years ago

      Nothing interesting

    • profile image

      josh Lantry 24 months ago

      tell me what i am doing wrong

      :swamp

      cls

      echo Ok! Let's hed to the swamp!!

      echo.

      pause

      goto swamp location

      :swamp location

      cls

      echo.

      echo %name%!! There is a green boogey monster

      echo.

      echo Do you

      echo A) Kill The Monster

      echo B) Run

      echo C) Say hi to it

      set /p where

      echo.

      if %where% A goto A

      if %where% B goto B

      if %where% C goto C

      pause

      :A

      echo.

      echo You grab a sword and stab the monster

      echo.

      echo you see a bag and pick it up it contains 1000 gold Pieces

      pause

      goto Start

      :B

      cls

      echo life of pie

      pause

      goto start

      :C

      cls

      echo life of pie

    • profile image

      Guys 23 months ago

      How to set timing at echoes. Example, the echo 5 then after 1 second another echo will appear, echo 4...

    • profile image

      Anurag Dhankar 22 months ago

      I have two questions from you :- ( 1 ) How to set a time for a particular question or an echo. ( 2 ) How to add a sound file to this coding....................please tell me quickly as quick as you can.

    • profile image

      Mr Awesome/Tom Keir 22 months ago

      Thanks for the tips but when I try to run it but it just comes up with command prompt HELP ME!!!!!!!!!

    • profile image

      Anurag Dhankar 21 months ago

      There are some other codings also.........like nul, timeout, etc. Please tell those codings also........thanks

    • profile image

      Sakxam Devkota 21 months ago

      hey,,can't we create a non txt-based game in notepad ??

    • profile image

      $MONEY$ 20 months ago

      Fun fact: You do know if you get good at coding you can get 300 dollars for doing it

    • profile image

      Tavor Wadsworth 19 months ago

      Hello. I did copy the program to see how it works and I can't seem to get the program to pause after choices A, B, and C in the SWAMP. The program displays the words for a split second and then automatically exits the game. How can I get the program to pause after each choice and then return to the start? Thanks for your help.

      @echo off

      color 21

      cls

      echo.

      echo Hello, what is your name?

      echo.

      set /p name=

      echo.

      title Name=%name%

      cls

      echo.

      echo Hello %name%, nice to meet you!

      echo.

      pause

      :start

      cls

      echo.

      echo SWAMP, TOWN, or MOUNTAIN?

      echo.

      set /p where=

      echo.

      if %where% equ SWAMP goto swamp

      if %where% equ TOWN goto town

      if %where% equ MOUNTAIN goto mountain

      if %where% neq SWAMP goto start

      :swamp

      cls

      echo.

      echo Ok! Let's head to the swamp!

      color 47

      echo.

      echo Oh No %name%! There is a monster!

      echo.

      echo Do you...

      echo A) Kill The Monster?

      echo B) Run?

      echo C) Say hi to it?

      set /p Where=

      echo.

      if %Where% A goto A

      echo.

      if %Where% B goto B

      echo.

      if %Where% C goto C

      echo.

      cls

      pause

      :A

      echo.

      echo You grab a sword and stab the monster

      echo.

      echo you see a bag and pick it up. It contains 1000 gold Pieces

      echo.

      pause

      goto start

      :B

      cls

      echo life of pie

      pause

      goto start

      :C

      cls

      echo life of pie

      pause

      echo.

      goto start

      :town

      cls

      echo ok! Let's head to the town!

      echo.

      color 67

      pause

      :good

      cls

      echo.

      echo That's very good %name%, excellent work, however there is one more test you must pass....

      echo.

      pause

      cls

      echo.

      echo You must take this firearm and shoot the man with the bag on his head....

      echo.

      pause

      cls

      echo.

      echo *shoot man*, *shoot interigator* or *take off bag on man's head*

      echo.

      set /p where=

      echo.

      if %where% equ *shoot man* goto done

      if %where% equ *shoot interigator* goto nice

      if %where% equ *take off bag on man's head* goto incorrect

      if %where% neq *shoot man* goto good

      pause

      :done

      cls

      echo Excellent job %name%. You have done well.

      echo.

      color 12

      pause

      goto start

      :nice

      :incorrect

      :mountain

      cls

      echo ok! Let's head ot the mountain!

      echo.

      color 57

      pause

      exit

    • profile image

      somya 18 months ago

      amazing very good

    • profile image

      muteeb 18 months ago

      hey its not working i have typed a program and copied it and pasted it on DOS but its not working i need help please guide me now what to do now

    • profile image

      anupam dodecha 14 months ago

      very very nice trick when i am getting bored or not having internet i use this to take intrest on pc

    • profile image

      txt based game 14 months ago

      Here's a great example of a cmd game made using python!

      https://github.com/ckonjeti/TEXT-BASED-GAME/blob/m...

    • profile image

      Abhimanyu 13 months ago

      Hey Good but my game is not working

    • profile image

      Cooper 12 months ago

      What do I do at the end do I save it as a batch file or what

    • profile image

      Lino 11 months ago

      Wow, I'm getting inspired to make my very own game

    • profile image

      vaibhav 11 months ago

      i copy your codes on notepad and save it as you instruct and then open it. its showing the codes only not the game

    • profile image

      MOSARROW 9 months ago

      HOW DO I ADD CHARACTERS TO MY GAME

    • profile image

      Lanz 8 months ago

      i have known that i trained it i dont need to search for that so no thanks.

    • profile image

      Tarushi 8 months ago

      my hobby are based on that part

      THANK YOU

    • profile image

      Jonah 8 months ago

      hey so i was wondering how would i go about having more options depending on which choise you make? like if i chose to go one way i get a different story than going the other way. sorry if i worded this wrong.

    • profile image

      Sumit 8 months ago

      hey alexander king how games like FIFA 17 are made ?

    • profile image

      Moose_pants 7 months ago

      Alex, i dont know if you still check theses messages, but i was wondering if you could help me out with my scripting with notepad++. i found an error that i cant solve...

    • profile image

      Moose_pants 7 months ago

      @echo off

      color 70

      :stage 00

      cls

      title ZOMBOCALYPSE

      echo.

      echo Welcome Survivor...

      echo.

      echo Please enter your name:

      echo.

      set /p name=

      echo.

      echo Welcome %name%

      pause

      :stage 01

      @echo off

      cls

      echo.

      echo

      echo.

      echo You wake up in an empty room

      echo.

      echo There is a knife on the floor, and a door to your left.

      echo.

      echo What do you want to do?

      echo.

      echo PICK UP KNIFE, or OPEN DOOR

      echo.

      set /p what=

      echo.

      if %what% equ PICK UP KNIFE goto stage 02

      if %what% equ OPEN DOOR goto stage 03

      :stage 02

      @echo off

      cls

      echo.

      echo You pick up the knife and turn towards the door

      echo.

      pause

      :stage 03

      @echo off

      cls

      echo.

      echo You open the door and a zombie springs on you!

      echo.

      echo Too bad you dont have a weapon to defend your self!

      echo.

      echo ~~~YOU HAVE DIED~~~

      echo.

      echo

      echo.

      echo Enter 'r' to restart, or 'e' to exit

      echo.

      set /p choose=

      echo.

      if %choose% equ r goto stage 00

      if %choose% equ e exit

      pause

      for some reason that script automatically closes after I do the first choice. do you know why?

    • profile image

      taj 7 months ago

      this doesn't work and is a wast of time :(

    • profile image

      Dreger 7 months ago

      @echo off

      :start

      cls

      title text adventure 1

      echo.

      echo by Dreger

      echo.

      pause

      echo Hello adventurer!

      echo.

      pause

      echo What is your name?

      echo.

      set /p name=

      echo.

      echo Hello %name%, my name is Dreger

      echo.

      pause

      echo This is my first game, so there may be some bugs

      echo.

      echo Are you ready?

      echo.

      set /p variable=

      echo.

      cls

      if %variable%==yes goto Chapter 1

      if %variable%==no goto start

      :Chapter 1

      echo.

      echo Chapter 1

      echo.

      echo.

      echo You wake up.

      echo.

      pause

      cls

      echo You see a computer and a bright wall in front of you. After a moment,

      echo you realize you are in your office cubical. You see on your shirt a badge.

      echo.

      echo %name%

      echo.

      :Company

      echo What company do you work for?

      echo.

      set p/ company=

      echo %company% is the company you work for?

      if %company%==yes goto Age

      if %company%==no goto Company

      :Age

      echo.

      echo How old are you?

      echo.

      set p/ age=

      echo So you are %age% years old?

      set /p dem=

      if %dem% equ yes goto Continuing

      if %dem% equ no goto :Age

      :Continuing

      echo. So you work at %company% and are %age% years old?

      set p/ regis=

      if %regis% equ yes goto Finally

      if %regis% equ no goto Company

      pause

      cls

      :Finally

      echo You see your computer screen has information about a virus that is being used to cure cancer.

      pause

      echo You read "Measles virus being engineered to cure cancer." When you scroll down a bit, you read

      echo "Virus is mutating and attacking brain cells instead of the cancer cells. The virus has recently

      echo been discovered to be airborne and is transmitted by bodily fluids."

      pause

      echo You see a bunch of comments on the article and one says "AVOID GETTING BIT AT ALL COSTS!!!"

      echo Another "Fill up your bathtubs, bottles, and everything with water. And board up your homes!"

      echo.

      pause

      cls

      :Chapter 2

      echo Chapter 2

      echo see ya tommorow

      pause

      exit

      It likes to clode automatically at "you wake up"

    • profile image

      7 months ago

      this site is gave me a knowledge of game programing in noteped

    • profile image

      Anuj 6 months ago

      After writing these codes how should i run it

    • profile image

      Guest77718364 6 months ago

      There's A Cool Guy In This Website!!!!

    • profile image

      Scott Meckley 6 months ago

      I'm curious if this will work in making my own dice game.

    • profile image

      matiw 5 months ago

      wow nice

    • profile image

      sahil 5 months ago

      how to open our game?

    • profile image

      Michael 4 months ago

      How do u actually run the game ?

    • profile image

      How do I play my game? 4 months ago

      How do I play my game?

    • profile image

      Mikael 4 months ago

      I couldn't get my to run properly

    • profile image

      mansoor shariff 3 months ago

      i have just made a program but i am able to go full that is not able to run properly so now what to do...

    • profile image

      lol 3 months ago

      IT is showing Who is not recognized as an internal or external windows batch file because i tried putting who instead of where...what shud i do?

    • profile image

      Edri Kopliku 3 months ago

      Very cool!!!!!! I followed your steps and I made very cool games! Thanks really much!!!

    • profile image

      Bigdyork 2 months ago

      I was wondering if i could use this type of coding to make an business application for collection info from clients. I would like to write it myself. As a career coach, there are a lot off things that need to be documented and used to print out the info. Can you help me?

    • profile image

      Erik 2 months ago

      How do you run the game after coding g it?

      Any help please

    • profile image

      Jambob 2 months ago

      Thank you I have prompt my Fred's that I will be making a game

    • profile image

      Akash 2 months ago

      It's very nice to learn the programing from this site thanks for teach me Google

    • profile image

      Baozar 8 weeks ago

      Please I want to know if we can also add pictures and images. For example, can we add the picture of a mountain or a town or a swamp like in d example above??

      Thanks in advance

    • profile image

      Ethan Redfern 7 weeks ago

      I knew you could do this but I just needed to be reminded of the set /p part, but thx anyway

    • profile image

      Abhishek sharma 7 weeks ago

      Can i write everything in small letter or i have to write with capital also

    • profile image

      VIVEK 7 weeks ago

      COOL

    • profile image

      Ediare festus 7 weeks ago

      Is it only the notepad or cmd because i am seeing both cmd codes and notepad

    • profile image

      Bilal 6 weeks ago

      Hey, so.

      I don't understand the %where% part.

      I made a little thing where the guy had to lie or tell the truth, and before closing, I receive a message saying "unexpected answer was given.

      At least, I think that's what it said.

    • profile image

      Mnm 5 weeks ago

      Wow, This was a very goodd tutorial on how to create a game via notepad...But when I made one, it was like, I am not able to go In the second situation even I'd I type the second option... I have written all Codes in order...Plz help

    • profile image

      nandan 5 weeks ago

      awesome

    • profile image

      ryan 5 weeks ago

      how to creat esecute name for standart game for PC?

    • profile image

      Lance 4 weeks ago

      whenever I try to go to a scenario it just closes the screen. I've checked the code, its right, but it just closes the game

    • profile image

      Hamzat 2 weeks ago

      If i want to add hello my name is omar how do i do it

    • profile image

      nati 10 days ago

      Hi.

      Can you help me after I do the code how can I test it plz. Help me

    • profile image

      Alec M.M. 9 days ago

      Is it possible to make the game fullscreen?

    • profile image

      Tony 6 days ago

      Thanks for this how can I make more efficient program

    • profile image

      mayilen 45 hours ago

      how do i start the game

    • profile image

      Aniket kumar 25 hours ago

      its good

    Click to Rate This Article