Angry Birds
A SFML based 2D c++ game
During my second year of university, as a part of a group of 4, we were tasked with recreating a level from the game Angry Birds. For my part of the project, I started with the very basic framework and added the level class. This was to be the main class that creates instances of pigs, birds and bricks and would handle the rendering function would hold the order that SFML renders each sprite in. (I did not create the pigs and so will not be talking about them)
The level class has a reverse parallax background effect that gives the game a sense of movement without the foreground having to be slid and adjust all the arcing math.
It also contains a reference to the queue of birds. i did not create the bird class but i did call the change of states at various points in the birds life span. Each bird starts neutrally, gets set to angry when the mouse fires the bird and then is briefly set to dead before that instance is popped from the queue.
The slingshot is also placed within the world but is created in 2 parts. the parts of the sling that will render in front of the bird, and the parts that render behind.
The level instance cpp file has all of the basic initialised variables and the instances of the birds being pushed to the queue. The R key is checked to clear and refill the queue in case the player wants to restart the level. if the other people added more functionality to the birds or added bricks, we could extend off of this R function to its own function. The parallax update function uses a smooth change instead of being set to exactly the birds position multiplied by a set factor as it caused jumping when swapping to a new bird.
In the video below, it shows an early version of my code without the level or bird class which used simple sf::circles to represent the bird. This version had the bands working but did not set a max range for the user to fire from yet.