{"id":29,"date":"2015-04-26T04:14:55","date_gmt":"2015-04-26T04:14:55","guid":{"rendered":"http:\/\/www.redcavestudios.com\/devblog\/?p=29"},"modified":"2015-04-26T04:19:22","modified_gmt":"2015-04-26T04:19:22","slug":"easing-functions","status":"publish","type":"post","link":"http:\/\/www.redcavestudios.com\/devblog\/?p=29","title":{"rendered":"Easing Functions"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/redcavestudios.com\/images\/blog\/linear_easing.gif\" alt=\"\" \/><br \/>\nIn reference to what I use for game development please see my <a title=\"FAQ\" href=\"http:\/\/redcavestudios.com\/FAQ.php\" target=\"_blank\">FAQ <\/a>page.<\/p>\n<p>I have been looking at easing functions to enhance game play.\u00a0 One useful method I have used such a function for is acceleration on flight path.\u00a0\u00a0 I used\u00a0 a slow acceleration function to slow the start of a missile when being launched.\u00a0 It has a better feel to the game when there is a slow acceleration.<\/p>\n<p>A normal movement by linear speed accomplishes the goal of getting the object to its destination, but a more meaningful visual is to perform a slow accelerate.\u00a0 Using an easing function can accomplish this.\u00a0 Granted acceleration can be accomplished over time in a game by adding speed for every game step event.\u00a0 This is another method.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Create Event<\/strong><\/span><\/p>\n<p>stepcount = 0;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Step event<\/strong><\/span><\/p>\n<p>speed=QUAD_EaseIn(stepcount, 0, max_speed, 1)<br \/>\nstepcount+=1;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Script (&#8220;QUAD_EaseIn&#8221;)<\/strong><\/span><\/p>\n<p>t = argument0\/room_speed \/\/step #<br \/>\nb = argument1 \/\/beginning<br \/>\nc = argument2 \/\/change<br \/>\nd = argument3 \/ room_speed \/\/duration seconds<\/p>\n<p>return c*(t\/d)*t*t*t + b;<\/p>\n<p>Hear is the updated result which IMO has a better feel.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/redcavestudios.com\/images\/blog\/easing.gif\" alt=\"\" \/><\/p>\n<p>Good luck.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In reference to what I use for game development please see my FAQ page. I have been looking at easing functions to enhance game play.\u00a0 One useful method I have used such a function for is acceleration on flight path.\u00a0\u00a0 I used\u00a0 a slow acceleration function to slow the start of a missile when being [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-game-dev-math"],"_links":{"self":[{"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":3,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":35,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions\/35"}],"wp:attachment":[{"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.redcavestudios.com\/devblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}