Hi everyone.
I'm a game development student at university. For our first assignment we have to create a text based rpg (think fighting fantasy or the hobbit) in html and javascript.
The course itself teaches programming from the very beginning. I've been a front-end web developer for a year now and a game developer for almost 2 now, so I have a lot more experience with programming. Those of us that are more advanced are recommend to go above and beyond the assignment brief to get the best marks and show our motivation for the subject.
I've begun working on the code itself and it's been suggested to me that I should use JSON (or something similar) to store the data. This includes the text for dialogue and flavour text, stats and that sort of thing. So whilst I've been programming my constructors I've tried to work around the basis that I'll be somehow parsing in this data.
Whilst I know that JSON is javascript (basically), I've tried to look into using it and parsing it into my code but I'm really struggling to understand how it can be done. It's not a very well documented area, with the only real methods I've seen to parse in the JSON is with jQuert by passing the JSON object into another variable. Surely at this point I might as well just be storing the data within my JavaScript in the first place? Is there no way to search within the JSON document and read data directly without storing everything in my JavaScript again?
If anyone has any suggestions on how I should be doing this, or any alternatives and resources, then please point me in the right direction.
Thanks, Joeb.