Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think these curves are meant only for animations. For game logic curves, you should choose an elementary function (https://en.wikipedia.org/wiki/List_of_mathematical_functions...) that fits your curve best and implement the math yourself. For an EXP-needed-to-level function, it would be simplest to implement an eponential curve (https://en.wikipedia.org/wiki/Exponential_growth) of the form cā‹…b^x. In your game, that would be (initial_exp ā‹… (growth_rate ^ level_number)). Or you could implement the quartic function (https://en.wikipedia.org/wiki/Quartic_function), which represents the easeInQuad curve you liked on the web page.


Thanks for the info. Yeah, I've already done that. I was just wondering if this could be used as an alternative. Since it can't be... what's the purpose of this library?


It's for CSS. That's why it's all just impressionistic graphs instead of numbers and equations; "impression" is exactly what these will be used for.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: