Any reason to use XML/JSON over dict's for data?

Discussion and feedback on Construct 2

Post » Fri Sep 06, 2013 2:00 pm

I've been working a while now on a vertical shooter and it's time to try and figure out when and how to spawn enemies. My first thought was to store the data in an XML file which is read into the game on start. Then it hit me that this might be an unnecessary step since i can simple store all the data in a dictionary right? On top of all that, wouldn't external XML files be vulnerable to manipulation from the user?

So anyway, I need to spawn certain enemies at certain points during the game -- like when the camera reaches Y position 4200 while moving up. What would you're thoughts be on this? When it comes to saving the game, then i would understand XML/JSON, but for simply reading in game data...

Thanks!hdnine2013-09-06 14:02:37
B
7
S
2
Posts: 38
Reputation: 555

Post » Fri Sep 06, 2013 2:38 pm

Have you looked at the Space Blaster demo game? It uses invisible objects placed in the layout to spawn enemies. No XML/JSON/Dictionaries used at all.
Scirra Founder
B
399
S
236
G
89
Posts: 24,543
Reputation: 195,430

Post » Fri Sep 06, 2013 4:39 pm

Right okay Ashley... I've been thought to instantiate objects when needed so to save on performance, but I guess that approach would work too. I'll consider using it thanks.

EDIT:

Oh... i see what you mean now. Works pretty good. ^^hdnine2013-09-07 07:58:07
B
7
S
2
Posts: 38
Reputation: 555


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests