IIRC, it is a simple placeholder variable to determine the direction you are facing for animations. The actual direction of your character is actually usually defined by your velocity. You'll notice that when you stop, your velocity doesn't go all the way to zero, but to some very small nonzero number (like 0.001). It uses the sign of this number to determine direction. This is then used to set goingLeft every frame, so I didn't have to type out something like "gVel < 0?False:True" every time.Neat engine! I’ve been experimenting with it today and I know I asked you this on GitHub but I’m case you’re not active over there, I was wondering what the variable goingLeft (in index.js) is used for. All I could figure out is that it’s true when the player character is going right and false when it’s going left.
what I’m trying to do right now is decouple the direction sonic is facing from the ground velocity so he can slide backward on slopes but I wanted to make sure I didn’t create redundant variables or break something important
edit: I’m not sure but this post might belong in the support forum