|
-
Feb 12th, 2011, 03:18 PM
#1
Thread Starter
New Member
Simple High Score System for Tetris Game
Hey guys,
I just finished making a Tetris game in VB.NET, and I wanted to add a high score system to the application. So, when a user completes their game, they have the option of submitting it as a high score, which will compare their score against the previous high scores, then place it accordingly. I was thinking of an XML approach of doing this, where the user's name, rank, score, level, and number of lines cleared will be stored in tags. Here is what I thought the XML might resemble:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Root>
<HighScore>
<Rank>1</Rank>
<User>"Blank"</User>
<Score>0</Score>
<Level>0</Level>
<Lines>0</Lines>
</HighScore>
</Root>
So the program will have an array to store all the previous scores. It will read through the XML, and copy the the score data into this array. Then, when the time comes to submit a score, it will compare this score against those previous scores, and find the proper position for that score, and then save it into the array. At the end, it will then copy all the score data from this array to the XML, replacing the <Level>, <Lines>, and <User> tags in the process.
I am however having trouble implementing this, as I have no experience with XML files and everything I've read has been very confusing. Any help you guys could offer would be sweet!
Thanks!
-Paul
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|