Simple Way To Make A Text-Based CMD Game

First thing is first, make a title for your game. Don't include //code! It's only to show where the actual code is in this article...
//code
@echo off
title My Game
//code

Next, add some color. What color do you want your text to be?
//code
color 0c
//code

Here we will add the first sentence you'll see upon running the game by using the echo command. Echo just displays a message.
//code
echo -----THIS IS GONNA BE SWEET-----
//code

Echo followed by a period (echo.) skips a line. Let's add more text.
//code
echo.
echo What now?
echo.
//code

Now is the time to add options.
//code
echo 1.) Start game!
echo 2.) Exit.
echo.
set /p var=Set Command:
if %var%==1 goto Start
if %var%==2 goto exit
:Start
echo YOU DID IT!
pause
:exit
//code

No comments:

Post a Comment