Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个球,当 OnClick 需要向上跳跃 150 像素并再次向下跳跃时。它需要在总共 1 秒(1000 毫秒)内完成此操作。
我尝试了几种方法。一个把时间一分为二,先上升,后半段下降……但它有点不稳定,也不是那么顺利。
有人有想法吗?
您需要一条从零开始并在 t = 1 时返回零的倒置抛物线。公式为:
y = k * t * (1 - t)
要计算出k,代入 ( t , y ) = (0.5, 150) 并求解k。