6 Replies - 1871 Views - Last Post: 18 April 2012 - 09:28 PM Rate Topic: -----

#1 xnaLearner   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 13-November 11

high score table...xml?

Posted 18 April 2012 - 02:33 PM

Hey guys.
I have a scoring system in my game at the minute. But when the games over it just declares the winner. I was thinking off add a high score table where the user can enter there name and save their details. Is this done through an xml file?
I had a quick look at your tutorials offered on here but didnt see any relevant, Any1 know of any good tutorials for this?

Or even if you could offer some advice on how to go about it would be great.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: high score table...xml?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14146
  • View blog
  • Posts: 56,698
  • Joined: 12-June 08

Re: high score table...xml?

Posted 18 April 2012 - 02:41 PM

XML, text file (most any file for that matter), a database, the project settings... there are a ton of places to do this.

The simplest is use the 'stream reader' and 'stream writer' to read a text file and save it ...
Was This Post Helpful? 0
  • +
  • -

#3 xnaLearner   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 13-November 11

Re: high score table...xml?

Posted 18 April 2012 - 02:43 PM

Sound good my man thanks for the reply...you know of any tutorials which use this?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14146
  • View blog
  • Posts: 56,698
  • Joined: 12-June 08

Re: high score table...xml?

Posted 18 April 2012 - 02:55 PM

Check out their documentation page.. pretty straight forward.

http://msdn.microsof...reamreader.aspx
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: high score table...xml?

Posted 18 April 2012 - 05:21 PM

If you have a high scores object you can just serialize it.

[*]Separating data from GUI - PLUS - serializing the data to XML
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5104
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: high score table...xml?

Posted 18 April 2012 - 09:08 PM

Serialization is a great idea, since it saves you the trouble of manually creating the XML.

For something this simple, an XML file or even a flat text file is probably the best bet, just because it's so simple. My suggestion is to use the AppData folder for storing application data, since that's what it's meant for (though many developers often don't even know about it). You can get the path from the Environment class.

For larger projects, I suggest using a compact DB, like Sql Server Compact, or Sqlite. You get the convenience of a database without the overhead of a server install.
Was This Post Helpful? 0
  • +
  • -

#7 xnaLearner   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 13-November 11

Re: high score table...xml?

Posted 18 April 2012 - 09:27 PM

That great guys....i'll get a shot at it tomorrow.

Thanks again
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1