Relative Content

Tag Archive for c++sfml

How to update transformation of sf::Transformable objects in a class (SFML CPP)

I am new to sf::Transformable class and just recently tried it out. After experimenting it a bit, I am facing an issue. When sf::Transformable object is placed in a class, which itself is derived from sf::Transformable, then whenever transformation method is called, it only updates transformation of the class’ object, not the transformation of the objects present in the class. However when we draw the stuff, It automatically manages the transformations and temporarily, and correctly position the objects for drawing. This should be fine in most cases, but what if we need positions of the object present in the class rather than whole object’s position. Maybe the object is board, and all the sf::Transformable objects are boardplaces, in this case, while we don’t want to align everything manually each time, we can derive it from sf::Transformable class but, while we want it to align everything automatically, but it should actually update their positions, or other transformations, because maybe we need them. A little program to demonstrate the problem :

Aim in sfml c++

I am making a bubble shooter game but i have an issue with my aim. The cannon moved but the bullets coming out of it goes only in one direction just straight