SamSuka
shaunjs
shaunjs

patreon


Week 27 - The Magic Line Of Code™

 

First of all: Thank you all so much. Thank you for the support you've given over the past few weeks while I've not been able to do the work I usually could. As a creator in a time where there is so much pressure to never-stop-putting-things-out, to have only made one video in the last.. four? five weeks? Feels atrocious no matter how well I might understand the toxicity of that kind of mindset.

Because while I've found peace with taking-the-time-I-need to work on complex videos, it's a whole different ball game when you're dealing with that as well as self-care, grievance and the pull of personal projects all across one big stretch of time. 

It's come at a cost financially as well, with an understandable dip in viewers, subs, patrons, etc. I want you to understand how invaluable you have all been to insuring that these last couple of months didn't have the career-ending consequences they sadly literally can have for other content creators on other platforms with less fortunate or forgiving circumstances. My luck in having you all is absurd.

Anyway. I'm "Back". By that I mean it's video time again. Finally.
I've been trying various different methods for this rope swinging stuff and finally I've happened upon what I think is the best method to teach and it centers around one very simple line of code for approximating circular acceleration with a bit of gravity.

And that's this bad boy:

var _ropeAngleAcceleration = -.1 * dcos(ropeAngle);

I won't spoil the full explanation here but this line of code creates the basic acceleration you see in a pendulum. Pulling downwards the most when the rope is horizontal, and pulling the least when vertical. It's not a perfect pendulum. As I said before, formulas for true pendulums are very complex. But this approximation is great for a video game context.

More to come! It's (very) good to be back.


More Creators