CMD_Game

A Command-Line game A game build with cmd code use of random FIND THE CODE BELOW

@echo off color 0A for /l %%a in (1,1,5) do ( cls call set "bar=%%bar%%." call echo LOADING%%bar%% ping localhost -n 1 >nul ) title CMD_GAME color 0A if "%1" neq "" ( goto %1) :Menu cls echo 1. Start echo 2. Credits echo 3. Exit set /p answer=Enter the option : if %answer%==1 goto Start_1 if %answer%==2 goto Credits if %answer%==3 goto Exit :Exit cls echo Thanks for playing! pause exit /b :Credits cls echo Credits echo. echo Created by Ayushmaan echo A random fighting game where PC will decide the random number of enemies if the enemy is more then 3 then you will defeated, either you will won the game. echo Thank you for playing [CMD_Gamen]! pause goto Menu :Start_1 cls echo Oh no! You're surrounded by enemies. echo There are five of them, and they're all armed. echo If you fight them, you are having a high chance of winning. echo To FIGHT-- PRESS F echo To RUN-- PRESS R set /p answer=Would you like to FIGHT or RUN?
if %answer%==F goto Fight_1 if %answer%==R goto Run_1 pause :Run_1 cls echo Come again another day. pause goto Start_1 :Fight_1 echo Prepare to fight. echo The enemies suddenly rush you all at once. set /p answer= Press 1 to start the fight : if %answer%==1 goto Fight_1_Loop :Fight_1_Loop set /a num=%random% if %num% gtr 4 goto Fight_1_Loop if %num% lss 1 goto Fight_1_Loop if %num%==1 goto Win_Fight_1 if %num%==2 goto Win_Fight_1 if %num%==3 goto Win_Fight_1 if %num%==4 goto Lose_Fight_1 if %num%==5 goto Lose_Fight_1 if %num%==6 goto Lose_Fight_1 :Lose_Fight_1 cls echo You were defeated. Play again? pause goto Menu :Win_Fight_1 cls echo You are victorious! set /p answer=Would you like to save? [y/n] if %answer%=='y' goto 'Save' if %answer%=='n' goto 'Start_2' :Save goto Start_2

Built With

  • cmd
Share this project:

Updates