[-] surlybaer@lemmy.world 9 points 1 year ago

Took a walk and figured out my issue. I shouldn't have used direction.x in the increments argument. move_toward figures that out for you.

10
submitted 1 year ago* (last edited 1 year ago) by surlybaer@lemmy.world to c/godot@programming.dev

So, I'm trying to rotate the player as they turn left and right in a top down view. The rotation works correctly when moving right, but fails going left.

Here's the code that handles the rotation

rotation = move_toward(rotation, PI / 12 * direction.x, PI / 2 * direction.x * delta)

The numerical values look right, giving me 0.261 rads going right and -0.261 rads going left ... but the rotation going left continues to go clockwise and stops just before a full 180.

Is there some quirk with rotation that I'm missing? My rubber ducks have remained silent.

[-] surlybaer@lemmy.world 3 points 1 year ago

Speaking generally, I'd prefer the first option as long as 'i' is actually an index or other valid key. I'm not sure what the overhead is in godot, but in general you should avoid conditional statements when you have a direct access method like a key or index.

[-] surlybaer@lemmy.world 2 points 1 year ago

I'm running TrueNAS Scale and have nextcloud, pihole and jellyfin all running flawlessly as docker containers. They have a hardware compatibility list if you want to reduce/prevent flakeyness in your setup.

[-] surlybaer@lemmy.world 47 points 1 year ago

I got too comfortable at work and would walk around barefoot. The place was really clean. One morning a manager noticed and got weirded out. Next day there was a company wide announcement that shoes were required at all times.

[-] surlybaer@lemmy.world 7 points 1 year ago

What We Stardew in the Shadows. It's gonna get weird fast.

surlybaer

joined 1 year ago