{"author_name":"angela","cat":"LD #31","comments":[{"author_name":"exdef","time":"December 1, 2014 3:10 pm","epoch":1417464600,"text":"Hm, I think you should just decrease the velocity of the snowball each frame and have gravity pushing the ball down each frame.","spam":"N"},{"author_name":"","time":"December 1, 2014 3:13 pm","epoch":1417464780,"text":"Ever tried thinking about what forces are excerted on an object, that makes it go in an arc?<br \/>\n I give you a tip: it&#8217;s gravity.<br \/>\n And gravity accelerates an object, meaning it&#8217;s changing the velocity of an object.","spam":"N"},{"author_name":"","time":"December 1, 2014 3:16 pm","epoch":1417464960,"text":"My games have terrible, constant speed, no velocity graphics. Do something really simple.","spam":"N"},{"author_name":"trianglPixl","time":"December 1, 2014 3:16 pm","epoch":1417464960,"text":"If you want to assume no air resistance, a parabola should be pretty simple. The horizontal speed is always constant since no forces are acting on it. Calculate it however you want and you should be set.<br \/>\n Vertical velocity is handled by a quadratic function. If you have an initial vertical speed, you can just choose to accelerate the ball downward (y -= gravity strength * time elapsed^2).<br \/>\n If you want to &#8220;throw at  speed in the direction of &#8220;, you have an initial position and an x distance and y distance, which helps you get your x speed and initial y speed.","spam":"N"},{"author_name":"dwild","time":"December 1, 2014 3:17 pm","epoch":1417465020,"text":"You will either have to use the good old equation of parabola, y = x^2 and work with that, or use gravity like exdef suggested. I don&#8217;t suggest the parabola because it become ugly fast and gravity is so simple.","spam":"N"},{"author_name":"TheColorMan","time":"December 1, 2014 4:18 pm","epoch":1417468680,"text":"Make the Y axis velocity decrease at a constant rate (like 0.1) every frame. Just like gravity, it will constantly accelerate things downwards. It doesn&#8217;t sound like it works at first, but it&#8217;s doing what gravity does.","spam":"N"},{"author_name":"quill18","time":"December 1, 2014 5:52 pm","epoch":1417474320,"text":"The solution is very straightforward.","spam":"N"}],"epoch":1417463880,"likes":3,"metadata":{"p_key":"25707","p_author":"angela","p_authorkey":"17857","p_urlkey":"61128","p_title":"THANKS!!","p_cat":"LD #31","p_event":"LD31","p_time":"1417463880","p_likes":"3","p_comments":"7","p_status":"UPD5","us_key":"17857","us_name":"angela","us_username":"angela","event_start":"1417737600","event_key":"26","event_name":"LD31"},"text":"<p><a href=\"http:\/\/ludumdare.com\/compo\/2014\/12\/01\/help-17\/arc\/\" rel=\"attachment wp-att-400952\"><img class=\"alignnone size-medium wp-image-400952\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc-300x251.png\" alt=\"arc\" width=\"300\" height=\"251\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc-300x251.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc-550x460.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc.png 576w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u00a0 \u00a0 \u00a0I&#8217;ve read the entire internet and I&#8217;m still haven&#8217;t figured this out. Can someone here help?<\/p>\n <p>I want Santa to throw a snowball. So I create a snowball object and on each frame I update it&#8217;s position by adding the vector to the position to get the new position.<br \/>\n But vectors are always linear. I&#8217;m trying to think of some way to use the algebraic function for a parabola to get the ball to travel an arc path &#8211; but nothing I try works.<\/p>\n <p>I *could* just do it with a bunch of if statements, like this: \u00a0(if snowball &gt; starting positition + 10){ reverse y direction; }<\/p>\n <p>But that gives me less of an arc and more of a sharp angle, plus &#8211; it&#8217;s not very elegant.<\/p>\n <p>If angry birds and Bloons can do it, surely it&#8217;s not too hard, right?<\/p>\n <p>UPDATE:<\/p>\n <p>Thanks everyone for your help! I think I understand it a *little* better now. I had more control when I turned off the engine gravity and made gy myself. Here are two solutions that worked really well for me in case anyone has this same issue:<\/p>\n <p>&nbsp;<\/p>\n <p><a href=\"http:\/\/ludumdare.com\/compo\/2014\/12\/01\/help-17\/arc2\/\" rel=\"attachment wp-att-401101\"><img class=\"alignnone size-medium wp-image-401101\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc2-300x251.png\" alt=\"arc2\" width=\"300\" height=\"251\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc2-300x251.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc2-550x460.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/12\/arc2.png 576w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u00a0 In the second one, playing with the first three variables gives you different sizes and speeds of arc on your ball.<\/p>","time":"December 1st, 2014 2:58 pm","title":"THANKS!!"}