Refire rate problems.

For questions about using Classic.

Post » Sat Oct 04, 2008 4:55 am

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.
Posts: 1
Reputation: 1,027

Post » Sat Oct 04, 2008 8:41 am

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
Posts: 351
Reputation: 2,377

Post » Sat Oct 04, 2008 4:50 pm

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.
Scirra Founder
Posts: 24,395
Reputation: 194,460

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests