Hi, in the code below I have a circle shape, which rotates around the player in my game. If I try to do a getPosition for the circle, it gives the point at which it rotates around. this is not what I'm looking for.
I want to be able to get the exact position where the circle is during its circular movement around the point. So I can use that position and shoot bullets towards the circle.
//header file:
sf::CircleShape c;
//cppfile:
c.setFillColor(sf::Color::Red);
c.setPosition(this->sprite->getPosition().x + width / 2, this->sprite->getPosition().y + height / 2);
c.setRadius(25);
c.setOrigin({1, -100});
c.rotate(1.f);
c.setPosition(this->sprite->getPosition().x + width / 2, this->sprite->getPosition().y + height / 2);
std::cout << "Circle.x: " << c.getEXACTPOS.y << " | Circle.y: " << c.getEXACTPOS.y << std::endl;
window.draw(c);
If there is a better solution to rotate a circle around a point, don't hesitate to tell me
If this is not possible, I am looking for a way to use the rightstick on a joystick to shoot in the direction it's pointing to.