0 Favourites

Refire rate problems.

This forum is currently in read-only mode.
  • Hi. First off, nice game creation tool that I may plan to use somewhere in the future.

    Second, I use a video capture program known as Fraps.

    My sample application involves a squiggly thing shooting green balls every around half second.

    Now when I go into record mode and purposely slow down my FPS down to 30 from 60, I noticed that the green ball's speed stayed the same but the refiring rate didn't.

    The squiggly lines like sprite has a private variable that counts down to 0 and resets after shooting the green ball.

    Is there such thing as a GameTime or elapsed variable that I can just apply(such as variable += value*elapsed in a different language) to the count down variable or have the bullet speed not sync with the game time(which would very useful for implementing the replay feature)?

    edit: sorry I had to move the topic to more of an appropiate section.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • The reason is probably timedelta based, if you had something like this:

    if Variable is less or equal to 0 - Shoot ball

    - set variable to 100

    always - subtract 100 * timedelta

    that would make it shoot once per second regardless of fps

    Although i know how timedelta works, i can't explain it well, your best bet is to look up the timedelta article on the construct wiki

  • Your game is not framerate independent. In other words, when the framerate changes, the way the game behaves changes. This is not good! If a player was playing on a slow computer you don't want the game to change for them as well.

    As Arcticus said, read about TimeDelta. If you say 'Always - subtract 1 from value', the value is subtracted once every tick, which is different speeds depending on the framerate.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
98 7,590
norum82's avatar
norum82
Unread hot topic
87 5,373
facecjf's avatar
facecjf
Unread hot topic
80 10,053
jonathanbencomo's avatar
jonathanbencomo