High Score system for a batch game

June 13, 2009 at 04:18:56
Specs: Windows 7
Hey guys!
I need help with a game I am making using a batch script.
I have developed a system that counts how many seconds it takes to complete a game, and then shows it at the end.
I can make that number go to a text file at any location.
What I need is someone to figure out how to display the highest score(s) or a so called High Score System. It would be highly appreciated, and this can also be used for other things. Love the one that is able to halp me.

I have the startup script for both the game file and the second tracking file:

@echo off
:start
echo Welcome to my game
pause
start registry_scr.bat
ping localhost -n 1 >nul
start game.bat
exit

______________________________
Then I have the game.bat here:

@ echo off
:1
color 4
echo Blue
SET /P M=
IF %M%==red GOTO 2
goto fail

:2
cls
color 1
echo Green
SET /P M=
IF %M%==blue GOTO 3
goto fail

:3
cls
color 6
echo Red
SET /P M=
IF %M%==yellow GOTO 4
goto fail

:4
cls
color 1
echo White
SET /P M=
IF %M%==blue GOTO 5
goto fail

:5
cls
color 2
echo Purple
SET /P M=
IF %M%==green GOTO done
goto fail

:done
cls
color 7
set /p var= <registry.txt
echo it took %var% seconds to complete the game.
echo %var% > history/%date%.txt
pause
exit

:fail
cls
echo FAILED
set /p var= <registry.txt
echo it took %var% seconds to fail'
echo %var% >history/fail/%date%.txt
pause
exit

___________________________________________
and finally the registry_scr.bat file here:
@ echo off

ping localhost -n 2 >nul

echo COUNTER SCRIPT
echo PLEASE IGNORE!
echo If game is done, please close this window.

del registry.txt
echo 1 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 2 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 3 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 4 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 5 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 6 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 7 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 8 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 9 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 10 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 11 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 12 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 13 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 14 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 15 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 16 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 17 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 18 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 19 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 20 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 21 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 22 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 23 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 24 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 25 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 26 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 27 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 28 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 29 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo 24 >registry.txt
ping localhost -n 2 >nul

del registry.txt
echo extremley many >registry.txt
ping localhost -n 20 >nul
exit


As I said, can someone please figure out a way to do this.
you may email me too if you wish:
deler_95@hotmail.com

also you may download the entire script HERE


See More: High Score system for a batch game

Report •


#1
June 13, 2009 at 06:33:19
why do you want to create games in batch?? try this instead

Report •
Related Solutions


Ask Question