Giter Site home page Giter Site logo

Comments (7)

jun-lu avatar jun-lu commented on June 26, 2024 3

基于帧 会让时间变慢,基于时间 会丢帧。 有意思

from blog.

hanxie-crypto avatar hanxie-crypto commented on June 26, 2024

用一下hype这类以时间线为基础的动画制作软件应该会更有启发,你甚至可以考虑做一个跟他一样功能的东西

from blog.

fhefh2015 avatar fhefh2015 commented on June 26, 2024

留言mark

from blog.

Thinking80s avatar Thinking80s commented on June 26, 2024

mark

from blog.

prettykernel avatar prettykernel commented on June 26, 2024

文章写得有点啰嗦,其实就是记录每两次 draw 之间真实的时间间隔,根据帧率计算出实际丢了多少帧,然后补偿一下。我认为直接把 update() 改为如下即可:

function update(dt) {
    left += param * (dt * 0.12)  // 根据时间差更新位置
    if (left > 300) {
        left = 600 - left
        param = -1
    } else if (left < 0) {
        left = -left
        param = 1
    }
}

from blog.

Blueria avatar Blueria commented on June 26, 2024

mark

from blog.

wangyuwen1999 avatar wangyuwen1999 commented on June 26, 2024

mark

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.