Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075919 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:15:41 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Best way to store NPCs, Monsters, Shops, etc for JavaScript game?
Pages: [1]
Print
Author Topic: Best way to store NPCs, Monsters, Shops, etc for JavaScript game?  (Read 389 times)
Guard
Level 0
***

Java's cool.


View Profile Email
« on: January 26, 2013, 09:38:54 PM »

OK, let's say I have a JavaScript game (preferabbly on jQuery framework) and its using HTML5 Canvas.

What would be your way of storing data to map out shops, monsters, and npcs? I was thinking maybe JSON txt files on the website? Or maybe simple text files and simple delimiters? I am not sure. How would you store that kind of data?
Logged

Programming since Sept 2009
Web Developing since 2006
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #1 on: January 27, 2013, 01:48:26 AM »

Yes, JSON. There isn't really much debate in the javascript world on this matter.
Logged
R.D.
Level 1
*


Hats = Awesome


View Profile
« Reply #2 on: January 28, 2013, 04:55:35 PM »

You should take JSON. Javascript can directly work with JSON-objects. Just make sure that you have a consistent pattern on them so the compiler can optimize stuff (At least on Chrome you can make sure that V8 will try to inline stuff and create internal classes from your objects and all the fancy magic).
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic