::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: N5 :: :: THE ENDURANCE GAME BY RCA PRODUCTION :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: USING W, A, S AND D, MOVE YOUR "X" CHARACTER AROUND THE 5X5 MAP :: :: YOUR GOAL IS TO AVOID THE ENEMIES, SHOWN AS 5 "A" CHARACTERS :: :: FOR AS LONG AS POSSIBLE. EACH "A" MOVES UP THE BOARD UP TO 2 :: :: SPACES EACH TURN. :: :: :: :: YOUR SCORE IS A COMBINATION OF THE NUMBER OF MOVES YOU SURVIVE, :: :: AND THE NUMBER OF POINTS YOU GAIN BY COLLECTING THE * UNITS. :: :: THE FORMULA FOR SCORE IS SIMPLE. :: :: # MOVES + 2*POINTS :: :: :: :: YOUR CHARACTER IS EQUIPPED WITH A LASER TO DESTROY THE "A" :: :: ENEMIES. IT CHARGES UP 10% EACH MOVE, UNTIL IT CAN BE FIRED. :: :: IT FIRES ONLY UP AND DOWN IN A COLUMN. IT "KILLS" THE A IN THE :: :: COLUMN IT WAS FIRED, FORCING THE A TO USE AN EXTRA MOVE BEFORE :: :: RETURNING TO THE GAME BOARD. :: :: USE CAUTION, IF YOU ARE TOO CLOSE TO AN A WHEN YOU FIRE, :: :: THE A MIGHT STILL JUMP ON TOP OF YOU AND KILL YOU! :: :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: EDITING NOTES: :: :: MOST VARIABLES AND SECTIONS ARE NAMED FOR CLARITY, HOWEVER, :: :: THIS WILL NOT EXCUSE YOU FROM NEEDING TO UNDERSTAND THE CODE. :: :: :: :: TO CHANGE THE NUMBER OF MOVES REQUIRED TO CHARGE THE LASER, :: :: CHANGE "lmoves" NEAR THE START OF THE FILE :: :: :: :: TO CHANGE NUMBER OF MOVES THE A MAY TAKE, ADD ADDITIONAL :: :: "call :rand" LINES DIRECTLY AFTER THE EXISTING ONES. :: :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: PROGRAMMED FROM SCRACTH BY RCA PRODUCTION :: :: RCAProductionMaster@gmail.com FOR QUESTIONS/COMMENTS/SUGGESTIONS:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @ECHO OFF setlocal EnableDelayedExpansion color 0b :start cls set movesold=0 set pointsold=0 set highold=0 set /a lmoves=10 set /a locx=0 set /a locy=0 set /a locx2=0 set /a locy2=4 set /a locx3=1 set /a locy3=4 set /a locx4=2 set /a locy4=4 set /a locx5=3 set /a locy5=4 set /a locx6=4 set /a locy6=4 set /a locxB=2 set /a locyB=2 set lose=false set /a points=0 set moves=0 set dCount=0 set destroy=false set lbar=Charging echo The goal of this game is to keep your X alive as many moves as possible. echo If you are hit by or run into an A you lose. echo Catch the * for extra points. echo. echo Each * counts as 2 moves for high score board. echo: if exist HS.meow ( ( set /p movesold= set /p pointsold= set /p highold= )" if %ERRORLEVEL%==1 (set /a locy=%locy%-1) if %ERRORLEVEL%==2 (set /a locy=%locy%+1) if %ERRORLEVEL%==3 (set /a locx=%locx%-1) if %ERRORLEVEL%==4 (set /a locx=%locx%+1) if %ERRORLEVEL%==5 ( if %dCount% GEQ %lmoves% ( set destroy=true set locy%var1%=6 ) if %dCount% LSS %lmoves% ( cls call :draw echo You do not have the power to use your laser yet. goto options ) ) :: Charging indicator set lbar=I for /L %%J IN (1,1,%lmoves%) do ( if %%J LEQ %dCount% ( set lbar=!lbar!# ) if %%J GTR %dCount% ( set "lbar=!lbar! " ) ) if %dCount% LSS %lmoves% ( set lbar=Charging... %lbar%I ) if %dCount% GEQ %lmoves% ( set "lbar=Charged. %lbar%I (Press N to Fire)" ) ::RCAProductionMaster@gmail.com :: Keep player in bounds if %locx% GTR 4 (set /a locx=4) if %locy% GTR 4 (set /a locy=4) if %locx% LSS 0 (set /a locx=0) if %locy% LSS 0 (set /a locy=0) :: End game if %lose% EQU true (goto lose) ::Counts set /a moves=%moves%+1 set /a dCount=%dCount%+1 :: Check for enemy locations coinciding with player for %%F in (2,3,4,5,6) do ( if %locx% EQU !locx%%F! ( if %locy% EQU !locy%%F! ( set lose=true ) ) ) :: Return enemy locations to bottom after reaching top for %%F in (2,3,4,5,6) do ( if !locy%%F! LSS 0 ( set /a locy%%F=5 ) ) ::Gain points- Has issues if random num is within IF statement SET /a randx=(%RANDOM%*5/32768) SET /a randy=(%RANDOM%*5/32768) if %locx% EQU %locxB% ( if %locy% EQU %locyB% ( set /a points=%points%+1 set /a locxB=randx set /a locyB=randy ) ) goto map :lose cls echo You died... echo You survived %moves% moves. echo You gained %points% points. set /a highscore=%moves%+(2*%points%) if not exist HS.meow ( ( echo %moves% echo %points% echo %highscore% )>HS.meow ) else ( ( set /p movesold= set /p pointsold= set /p highold= )HS.meow echo: echo New High Score $ ) echo: echo Your Score: %highscore% echo: echo HIGH SCORE: %highold% echo MOVES: %movesold% echo POINTS: %pointsold% echo: pause>null goto start :rand SET /a _rand=(%RANDOM%*5/32768)+1 IF %_rand% EQU 1 ( set /a locy2=%locy2%-1 ) IF %_rand% EQU 2 ( set /a locy3=%locy3%-1 ) IF %_rand% EQU 3 ( set /a locy4=%locy4%-1 ) IF %_rand% EQU 4 ( set /a locy5=%locy5%-1 ) IF %_rand% EQU 5 ( set /a locy6=%locy6%-1 ) exit /b :draw echo Position: %locx%%locy% echo Moves: %moves% echo Points: %points% echo Laser: %lbar% echo. echo %m00% %m10% %m20% %m30% %m40% echo. echo %m01% %m11% %m21% %m31% %m41% echo. echo %m02% %m12% %m22% %m32% %m42% echo. echo %m03% %m13% %m23% %m33% %m43% echo. echo %m04% %m14% %m24% %m34% %m44% echo. exit /b