Timber Guy using C++ with SFML

Introduction
Just finished writing my fully working and functional game-engine (Lumberjack) in C++ and Objective-C++. I am a huge fan of C++ and love incorporating physics into my programming. I plan to expand and evolve this code to add more features.
Tool: Xcode
Library: SFML

Working Theory
1. Created shapes (tree, branches, player, clouds, bee, axe, log, gravestone) using SFML Texture, Sprite and draw and added movement to the shapes.
2. Added a time bar to keep track of player’s remaining time as well as to respond when the player runs out of time.
3. Handled player’s input (keyboard input, mouse positions and inputs) and player’s death.
4. Added sound effects for log chopping, player ran out of time and player’s death using SFML sound class.
5. Added score and message text using Text and Font class of SFML.
6. Handled growing and updating branches, pausing and restarting the game and collision detection with screen and objects.


Learnings and Why I use C++

With any new project, the goal should always be to learn and understand the concepts of programming, i.e. the principles such as memory-management, object-oriented programming (OOPs), compiling & linking. The goal should not be to get the results as fast as possible, as it interferes with creating good codes. C++, in a way, forces you to create clean solutions and care for memory or otherwise the game just won’t work. This is the benefit of working with pure compiled languages as the compiler tells you to do it correctly or things will crash. This could be hard in the beginning but you will learn a lot of stuff in a short time. Also, Garbage-collection is nice, it's convenient to not care for the memory but with game programming, garbage-collection could lead to unpredictable performance glitches (short pausing of the application). C++ makes you the master of construction and destruction and you are able to control when memory is allocated and freed. Lastly, performance is always relevant, and applications should be platform-independent.



Demo