DEVLOG #18
After a loooong time I managed to create working underground block spawning system:
- Made a working tilemap that has the same values as the surface one
- Instead of grass and water there are stone and lava
- Because I don’t have a sprite for a stone, there is a tree sprite as a placeholder
At first, it was very laggy and kept crashing my game. I wanted to spawn 31 000 objects at once.
To keep away my pc from exploding I added:
- Chunking - The script is spawning only what player see
- When the chung goes out of the sight, it gets deleted
- After 15 blocks created the script takes a break for a frame
It’s still not perfect, but the game now runs at 150+ fps no matter what