For my SFML demo, I’ve managed to incorporate a few new features and tidied up the coding a lot! While the game itself hasn’t changed much since last week, the coding is substantially better and much more advanced!
I’ve updated the Rocket’s Fire Particles, so that they look a bit better. It’s essentially three types of particles – Red, Yellow, and White – which all have different lifetimes and densities. By using them, it makes the rocket look like it’s shooting fire out the back, and I’m very happy with the results. It makes the game look much more professional than just having an animated sprite of fire behind the player! Plus, by using SFML Primitives in a Vertex Array, it can render thousands of particles without the slightest dip in performance! (though there are only a couple hundred in this screenshot)
I’ve also worked on the Rendering System. I’ve created a class, Renderer, which has several groups of Pointers to Game Entities. Each group accounts for a layer onscreen. By doing this, I can set Entities to be drawn behind or in front of each other! I can set specific objects to have different depths, such one block is behind the Player and another in front.
The last major thing I’ve been working on is the Level Builder itself, or Construction Mode as I’ve taken to calling it. Entered by simply pressing a button during gameplay, here I can place, delete, or move objects around. Then, by pressing the button again, it returns to gameplay. This is the feature I’m most proud of, and has received (by far!) the most work. I’ve divided my Game Entities into three groups; Dynamic Objects (Player, Blocks), Static Objects (Backgrounds), and Particle Objects (Fire, Rocket Thrusters). I’ve only managed to implement the Level Builder to work on Dynamic Objects right now, and it can edit any Dynamic Object. By using The Console, the user can enter the name of the object, say ‘Player’, the move the player around the screen, choosing their start point! By changing the name to ‘Block’, the player can begin placing and deleting blocks without exiting the program. The data is outputted to a .txt file, which is how the objects data is stored.