Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Question regarding the use of JSON files — Gideros Forum

Question regarding the use of JSON files

FaustoMFaustoM Member
edited June 2015 in General questions
Hi. I am following the tutorial provided in the ebook Gideros Mobile Game Development and the author uses a json file to add levels. He does not explain anything regarding json or how to create it, so I assumed that if I Right Click>Add New File and change the .lua to .json it would work but I cannot edit the resulting file... I am not sure if that is the correct way to create json but there is nothing about the creation there, he just says to create one and add code to provide the position of the game objects (some balls). If I check his code and double click his json files I can't open or edit them. It this normal? Am I missing some program or addon to edit json? He says there are programs that do this, I checked and there is a Tiled and Tiledasworldeditor... does any of these work for a breakout/arkanoid like game or are those for tile based games?

Sorry if this question is too basic. I am just starting and I do not know a lot of things. Thanks in advance for taking the time to reply.

Comments

  • piepie Member
    Accepted Answer
    @FaustoM to make it as simple as I understood it :(|), a json file is a text file with .json extension, and it is written following certain rules.
    These rules allows save/storage of tables, numbers and strings.

    You can open any json file with notepad, notepad++ and any other text editor, or you can use a json editor. I use this one on complex files, because it has a fancy tree view which makes it easier to keep track of things: http://tomeko.net/software/JSONedit/

    I don't know why gideros can't edit json :)

    Tiled is not a json editor (maybe it can use json in some way don't know that), but a "level" editor. It can export lua files, so you can import tiled "levels" in gideros. Then you will have to do something with the level data.

    You can find some more info on tiled and cell properties here, check my last post for an example.
    http://giderosmobile.com/forum/discussion/5361/level-editor-of-choice/p1

    I think that you could use tiled to build levels for an arkanoid-type game, but i think that you can also use json, or use them together. Both ways could have pros and cons, basically json is much more lighter, but it could be "uncomfortable". Tiled has a friendly gui, but a heavier "output". :)

    Likes: FaustoM

    +1 -1 (+1 / -0 )Share on Facebook
  • @pie Thanks a lot for the comprehensive and thorough answer. I was really busy these days and could not thank you properly in time for all that information and links.

    I downloaded JSONedit to check it later. I already had Notepad++ (I did a little modding for Dungeon of Dredmor at Steam's workshop) so I may as well use it to finish this tutorial quickly and later check the other.

    Again. Thanks a lot! All the info was really helpful.
Sign In or Register to comment.