I am looking to storage game levels ( level variables and a level 8x8 grid layout ) as a json string so I can;
Store game levels as json strings stored as a text file, which is read in and converted into app inventor data structures so the level can be played. An example ( shortened ) of a level is
{
"Level": 1,
"Target_Score": 5,
"Time_Before_Water_Release": 5,
"WaterStart": [
0
],
"initial_maze": [
[
{
"Base_Block": "topright_block.png",
"Angle": 90,
"WaterLevel": 0,
"WaterOutflow": [
-1,
-8,
9,
1
]
},
{
"Base_Block": "topright_block.png",
"Angle": 90,
"WaterLevel": 0,
"WaterOutflow": [
-1,
-8,
9,
1
]
}
],
[],
[],
[],
[],
[],
[],
[]
]
}
here the grid is rather than a 8 x 8 grid a series of 8 rows and the first row described to 2 columns.
My initial thoughts were to write each level as a line in a file, read file and for each line convert using either
the problem I see is only simple json is supported,ie a list or a dictionary but not a multi data type piece of json which has to be refactored ? Is there a extension or similar that supports this before I reinvent the wheel