PSE Game Physics - Summer 15 - FAQs

From Sccswiki
Jump to navigation Jump to search

Questions to Worksheet 1

  • Q: How can I get the number of seconds elapsed during the last frame?
  • A: This value is stored in 'frame_elapsed_seconds'
  • Q: The integration method is called by no method.
  • A: Calling this method at an appropriate point is one of your tasks to get familiar with the engine.
  • Q: How can I change the position of an iPhysicsObject
  • A: You can use the translate() method of the object.
  • Q: With activated desktop effects, the window content isn't updated as fast as the displayed FPS and by far less than 50 FPS. What's the problem?
  • A: There seems to be an window-title-update problem with the newest Ubuntu version when the window title is set to a new string frequently during one second.
    To solve this problem, avoid updating the window title. Replace the corresponding lines in file 'main.cpp' with this code to render the desired information just on-screen:

 * update window title
title_text << "   Scene: '" << cScenes->scene_description << "'";
title_text << "   FPS: '" << engine.time.fps << "'";
engine.text.printfxy((float)20, (float)engine.window.height-20, title_text.str().c_str());