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

Author Topic: Learn  (Read 1141 times)

0 Members and 1 Guest are viewing this topic.

catalinnic

  • Newbie
  • *
  • Posts: 19
    • View Profile
Learn
« on: February 19, 2019, 01:49:40 pm »
Hello, I have 2 questions to ask:
1. I have a variable set for PlayerSpeed=0.2 and if i move the project to a newer hardware the player moves twice as fast why?
2. How i can clear the window without a static image wich stands for map?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Learn
« Reply #1 on: February 24, 2019, 11:52:40 pm »
1) Multiply the speed by the amount of time passed for that frame (probably in seconds but any measurement is fine really as long as its consistent; also remember that you might need to multiply the overall values with a large constant (possibly 1000+, depending on your system's speed) to get it back to the speed you expect). You could also try setting a framerate limit to get a simple approximation of stable frame times.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*