ゲームでプレイヤーを描画するために requestAnimationFrame を使用しています。プレイヤーの 1 人が他の誰よりも速く動いています。彼に確認したところ、モニターのリフレッシュ レートは 120hz であるとのことでした。これは、他のフレームよりも高速にフレームを処理できるため、移動速度が速くなることを意味すると思います。どうすればこれを回避できるかについてのアイデアはありますか?
ありがとう
使用されるシム レイヤーは次のとおりです。
// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback, /* DOMElement */ element){
window.setTimeout(callback, 1000 / 60);
};
})();