I made this game in the first year of the NHTV, it is entirely made in C++. This was a solo project. I used for this my own openGL render, physics and collision system. The OpenGL is on an older version as the project I made in my second year.
The game is a billiard game where you have to get 3 balls in the holes. With the mouse you can apply force by holding the mouse button shorter or longer. The line will indicate where the ball is headed towards.
Above you see how I make in the game.cpp the player ball. I first make a class, ControllableBall, which is an inheritance of ball, which on it is turn inherits from ObjectInterface which is an engine class. Then I call an engine function which registers the ControllableBall as a game object within the engine. As arguments I give it an url to a sprite, the class, the name of the object and lastly true for rigid body. This will make sure it gets a rigid body which means I can apply forces to it easily with the AddForce engine function. Then I set a position on the sprite via the engine. I then add a circle collision to it with the AddCollision call. In this call you give the object, then the type of collision, then if it has motion (needed for calculations) and then if it is a trigger or not.
As you can see the engine I made is quite extensive and is easy to use for making small 2D games. See for a deeper look at the engine code my portfolio piece; Own OpenGL engine.
Above you see the calculations for applying the force in the PlayerBall class. You see that it heavily relies on the engine I made myself. For example, it uses AddForce on both the other object and player ball itself. It calculates the force by using the velocity and the dot product.