游戏中的帧时序

发布于 2024-09-30 13:23:44 字数 106 浏览 0 评论 0原文

我决定在我的节奏游戏中从基于毫秒的计时转换为帧计时。我知道我可以检查动画的当前帧来获取按下按钮的时间,但是当动画结束并且我想要最后有大约 100 毫秒的“延迟缓冲区”时该怎么办?我可以依靠计时器吗?

Ive decided to convert from doing millisecond based timing to frame timing in my rhythm game. I understand I can check the current frame of the animation to get timing for a button press, but what about when the animation ends and I want a "late buffer" of about 100 milliseconds at the end? Can I rely on a timer for that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

固执像三岁 2024-10-07 13:23:44

如果您将其限制为易于实现的帧速率,您将能够做到。这样您就会知道每秒运行多少帧,从而知道需要等待多少帧。

或者,您可以将两者混合起来并记录动画最后一帧运行的时间,并且在记录的时间加上 100 毫秒过去之前不允许它重播。

我认为现在大多数人在游戏中使用基于时间的计时,因此如果不需要编写帧,他们可以做一些其他处理

You will be able to if you limit it to a easily achieviable frame rate. That way you'll know how many frames per second you're running on and thusly how many frames you need to wait.

Or you could do a mixture of both and record the time the last frame of your animation ran, and dont allow it to replay untill the recorded time plus 100 milliseconds has passed.

I think most people use time based timing in games now adays so they can do some other processing if the frame doesnt need to be written

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文