How can I store cool levels and sweet resources cozily
Posted: Mon Jul 09, 2018 8:40 pm
Hello to the LÖVE community!
Two awesome buddies and I are developing our first game, a top-shooter inspired by manic-shooters such as Touhou Project, Ikaruga. But we do like other games, like narrative, role playing games or 3D action RPG.
Anyway, we are a bit discovering Lua and LÖVE2D all at once, and as the dude in charge of organizing the programming, I was wondering about code organisation and resource management.
First, levels serialization. Our levels are composed of fine-drawed background, evil enemies with their patterns, blocking obstacles and the like. All of those are placed on certain coordinates, some are moving... We also have events and levels with differents phases (for instance, you kill a certain number of enemy type "bob", then "superbob" is coming to avenge them and replace them). Those do represent reasonable challenges enough for us, programming-speaking, but I would be happy to have your inputs. How do you store levels as complex entities? Are there standards formats (XML, CSV)? What tools exist to generate and read them? Especially, are there any map generator tools, or level generation?
Second, code organization. We separated our code in four main files:
player.lua, managing movement, drawing and bullets of players
enemy.lua, doing the same but for enemies. We split them from players because they follow patterns, which are special structures that drive how they move and shoot
map.lua storing our maps. For now we hardcoded our first level with its obstacles and spawn zones, but I would like to load them from the outside.
main.lua, doing a bunch of stuff, including animations and collisions.
This is a bit messy and our code is having some sort of existential crisis, not knowing were it belongs. Do you have any inputs on how to organize our code better?
Thank for your answers
Two awesome buddies and I are developing our first game, a top-shooter inspired by manic-shooters such as Touhou Project, Ikaruga. But we do like other games, like narrative, role playing games or 3D action RPG.
Anyway, we are a bit discovering Lua and LÖVE2D all at once, and as the dude in charge of organizing the programming, I was wondering about code organisation and resource management.
First, levels serialization. Our levels are composed of fine-drawed background, evil enemies with their patterns, blocking obstacles and the like. All of those are placed on certain coordinates, some are moving... We also have events and levels with differents phases (for instance, you kill a certain number of enemy type "bob", then "superbob" is coming to avenge them and replace them). Those do represent reasonable challenges enough for us, programming-speaking, but I would be happy to have your inputs. How do you store levels as complex entities? Are there standards formats (XML, CSV)? What tools exist to generate and read them? Especially, are there any map generator tools, or level generation?
Second, code organization. We separated our code in four main files:
player.lua, managing movement, drawing and bullets of players
enemy.lua, doing the same but for enemies. We split them from players because they follow patterns, which are special structures that drive how they move and shoot
map.lua storing our maps. For now we hardcoded our first level with its obstacles and spawn zones, but I would like to load them from the outside.
main.lua, doing a bunch of stuff, including animations and collisions.
This is a bit messy and our code is having some sort of existential crisis, not knowing were it belongs. Do you have any inputs on how to organize our code better?
Thank for your answers