Tuesday, July 19, 2011

C string


C stringBasically, I'm going to have a header file where I store int definitions, such as HavePickaxe. If HavePickaxe = 1, line 1 of the .txt file will be "1", meaning the player currently owns the Pickaxe item. If the player does not have it, it will of course be 0.This way, when they player's going along in his adventure and comes across a Pickaxe, my game will make HavePickaxe = 1, which will then be written to line 1 of the .txt file. This file can be written (Save) or read (Load), and by using #define I can change values such as Gold to P1Gold and go from thereThe values in the current .txt are just placeholders to see if I can assign (and read) 6 values to the array.If it helps, just ignore the code I have above. It's very patchwork; I'd be willing to scrap it if I can find a more efficient way of doing what I've just explained.
Share/Bookmark

No comments:

Post a Comment