Week 10 | Red Plane1942

This is the last week of project Red Plane 1942. I started to implement an object-pool as discussed in previous posts. The object pools purpose is to instantiate a few objects of each  necessary class and then later on in the game use the instantiated ones instead of instantiating new ones. The objects would have a visible/active boolean and they would not be drawn or updated when not visible/active. When wanting to use a certain object there would be a loop that check if there is any inactive objects and if so reset and return that object. By having this object pool there is no need for instantiating or deleting objects back and forth as I have previously done.
I started by doing this in a copy of the project because I knew i had to change a lot of things and i did not want to make the real project messy. After a while i realized I was not sure how to write the theory in code. I know how an object pool is supposed to work in theory but I am still unsure how to write it in code… I went back to the original project and discarded the copy. I will definitely give the object-pool a shot again but the next time I will try implementing it from the beginning.

This took a lot of time and the project was not worked on the last two days because of other reasons. I am still very happy with the final product. Even though i have worked with C# and XNA before there was still more trouble than expected using C++ and SDL. Throughout this project I’ve learned a lot about C++ and SDL, mainly how and what pointers are in C++.

About Semih Parlayan

2014  Programming