Computing.Net > Forums > Programming > High Score system for a batch game

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

High Score system for a batch game

Reply to Message Icon

Name: Windoves
Date: June 13, 2009 at 04:18:56 Pacific
OS: Windows 7
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: June 13, 2009 at 06:33:19 Pacific
Reply:

why do you want to create games in batch?? try this instead


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: High Score system for a batch game

High Score with Flash 5 www.computing.net/answers/programming/high-score-with-flash-5/1355.html

Date question for a batch www.computing.net/answers/programming/date-question-for-a-batch/16789.html

coding for a game www.computing.net/answers/programming/coding-for-a-game/10576.html