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

Author Topic: [SOLVED]Assigning a direction to bullets from a vector  (Read 10589 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: [SOLVED]Assigning a direction to bullets from a vector
« Reply #15 on: February 14, 2013, 07:49:42 pm »
dt means delta-time, this is the time passed in one frame (1 iteration of the game logic loop).

Your approach only works for a constant logic frame rate. The interval doesn't remain the same if you change the frame rate. Furthermore, you cannot specify an intutive time as an interval -- with sf::Milliseconds(200), you know that exactly 5 bullets are shot every second.

By the way, there is the increment operator to increase variables by 1:
++accumulator;
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

bumblecorn

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [SOLVED]Assigning a direction to bullets from a vector
« Reply #16 on: February 14, 2013, 08:09:29 pm »
I see. Well I have the frame limiter set to 60, which should remain consistent right? Unless I decide to run it on a typewriter. For now I will leave it as it is, although I can think of other parts of the game where your code might come in handy. Anyway, thanks for the help, I do appreciate it :D