Settings don't have to match the actual object.
Secret of the Basilisk (prototype) » Devlog
While trying to figure out how to do my maps, I was writing the json for the config file. For each tile, I needed a few properties. I started up with the tile information id and an angle. I ended up with a lot of bytes and the config file was getting big.
tilesInfo: [
{
tileId: 1,
angle: 1
},
{
tileId: 1,
angle: 1
},
{
tileId: 1,
angle: 1
},
{
tileId: 1,
angle: 1
},
{
tileId: 1,
angle: 1
}, ...
]
I decided to split the properties into two same size array.
tilesId: [1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1],
tilesAngle: [1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1]
This made the config file much smaller and easier to edit manually. After loading the data in memory, the tile id and it's angle will be combined properly in the object.
function TileInstanceInformation() {
this.id = 0;
this.tileRef = 0;
this.angle = 1;
} function SectionInformation() {
this.id = 0;
this.name = ""; this.width = 0;
this.tilesInformation = []; // Array of TileInstanceInformation()
}
The config file does not need to be in the same format as the object in memory.
Secret of the Basilisk (prototype)
IDLE, incremental game with a bit of a story.
Status | On hold |
Author | Fluffy Lotus |
Genre | Adventure |
Tags | 2D, Idle, Unity |
Languages | English |
Accessibility | One button |
More posts
- How I'll start developing my new gameJan 04, 2020
- Building up the storyNov 25, 2018
- New quest UINov 08, 2018
- UI TweakingNov 07, 2018
- First version of the new gameOct 27, 2018
- Player stats; 1.3 or 13?Oct 18, 2018
- Battle SimulatorOct 15, 2018
- Starting to implement the story!Oct 09, 2018
- Figuring out what to do with experienceOct 07, 2018
- Working on the UISep 28, 2018
Leave a comment
Log in with itch.io to leave a comment.