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

Author Topic: Additional question about the official code on the book  (Read 1257 times)

0 Members and 1 Guest are viewing this topic.

PewPew

  • Newbie
  • *
  • Posts: 22
    • View Profile
Additional question about the official code on the book
« on: October 28, 2014, 02:32:27 pm »
Since this is not included on the book..
Just wanna know whats the purpose of this and what does it do


const sf::Time Game::TimePerFrame = sf::seconds(1.f/60.f);

Its on the very top of game.cpp before the declaration of constructor

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Additional question about the official code on the book
« Reply #1 on: October 28, 2014, 02:48:25 pm »
Isn't "TimePerFrame" expressive enough? ;)

That's how long one iteration of the game loop is supposed to last: 1/60 of a second.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

PewPew

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Additional question about the official code on the book
« Reply #2 on: October 29, 2014, 09:44:00 am »
It is. I like to delete my thread when i found what it is but i cant.

 Sorry

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Additional question about the official code on the book
« Reply #3 on: October 29, 2014, 02:42:55 pm »
No worries, glad it's solved. Just keep the thread, it will slowly get lost in the depths of the forum :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: