XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Save/Load Game

Last post 5/13/2009 1:18 PM by Katana314. 3 replies.
  • 5/12/2009 4:23 PM

    Save/Load Game

    Right now for a game project I am currently doing I have set up 7 save and load slots. I also have set up the save file to write out to a file giving the name with the current date, current level and slot number, but when I open the game back up I am having trouble finding the files and placing them in the correct save slots...I am not exactly sure how to do this...any help will be great thanks :)
    --- Thanks

    MiR x Envy ---
  • 5/12/2009 4:29 PM In reply to

    Re: Save/Load Game

    You are saving 7 game saves to 7 different files, say, save1.dat thru save7.dat.  Can't you just enumerate through them all and load the information, and extract what you need, to show on the screen, and then when the user selects one of them, load the entire file for game restoration?
  • 5/12/2009 4:34 PM In reply to

    Re: Save/Load Game

    In Windows you can do this:

    string[] dirFiles = Directory.GetFiles(directory, "*.filetype");

    I dunno if that's available on Xbox though.

    Another approach you can do is another "lookup" file which simply appends each filename you've saved. Alternatively, just do what JasonD suggested :)
    PebbleDash - Released
    Abstacked - Released
  • 5/13/2009 1:18 PM In reply to

    Re: Save/Load Game

    Yeah, I kind of doubt end-users would be so interested in navigating to your save directory and looking at your filenames. Just having short, predictable filenames like save#.sav should work for you, and you can include data like save time in its data.
Page 1 of 1 (4 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG