Last active
September 1, 2016 06:38
-
-
Save ikeryou/349473fd24d9628eaa5ae347e358e03a to your computer and use it in GitHub Desktop.
イージングアウト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 目標値 | |
var t = 100; | |
// 現在値 | |
var val = 0; | |
function update() { | |
val += (t - val) * 0.5; | |
if(Math.abs(t - val) < 0.5) { | |
val = t; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment