Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Shape "following" the end position of a sprite  (Read 1106 times)

0 Members and 1 Guest are viewing this topic.

tank69

  • Newbie
  • *
  • Posts: 9
    • View Profile
Shape "following" the end position of a sprite
« on: April 13, 2016, 10:04:02 pm »
Hi everyone. I have a tank, a turret and an a bullet that i have drawn on the window. the tank and its turret are sprites, and the bullet i used an sf::CircleShape. i just wanna ask if this is correct..and how should i set the position of my sf::CircleShape object to be always on the edge of the turret, like for example user gave a certain angle of the turret so the turret rotates and the sf::CircleShape object follows..

this is really rather simple to you guys, i am an absolute beginner, this is my first game that im trying to create.
any advice would be much appreciated. "Tanks" in advance. :) ;) :)
« Last Edit: April 13, 2016, 10:06:23 pm by tank69 »

fallahn

  • Hero Member
  • *****
  • Posts: 501
  • Buns.
    • View Profile
    • Trederia
Re: Shape "following" the end position of a sprite
« Reply #1 on: April 13, 2016, 11:47:31 pm »
Look up Scene Graphs. The SFML Game Development book provides a good example of this.  ;)