How would i get a high score table, that records the name of the player and their score, then save it into a file named "score.ini" located in the application's path?
Then, be able to look at the highscore table and see all the names and scores there by loading the scores in "score.ini"?
Err... Would it be shorter if i wrote it into another file, say a .txt file or another extension that could be made up?
More info:
The two variables i need to record are "name" and "efficiency". At the end of a game, a screen will pop up asking for their name. After pressing ok, another screen will pop up, showing the top ten scorers and their names.
I was thinking maybe using this code and a listbox:
You need to add Microsoft Scripting Runtime, Scrrun.dll to your References.
Public fsObj As FileSystemObject
Put it at the top of the Form code window or in a Module if more than one Form uses it.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Attached is the code to a small VB game. It contains a class called CHighscore that you can use in your program to save highscores, however it saves to the registry instead of a file. You can use the game as an example on how to use the class. Please don't comment to much about the game itself, it doesn't use any back buffering so it's kind of flickery. I made it in a couple of hours just to show my brother that you can use VB to create simple games in a very short time.
score.ini? in pure text? I would think you might want to encrypt it and call is data.ini so people want cahnge it to 999,999,999 unless its your own small game and you need no use to cheat...
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT