For what I'm working on, I need to figure out what direction the player is facing and, from that, be able to derive points on the X-Z plane that go linearly in that direction from the player's X-Z coordinates.
How could I go about doing that?
Rollback Post to RevisionRollBack
Comic artist, indie game dev, lots of things. Click image to check out my latest comic series?
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)
There are essentially 8 compass directions the player can face and move in: +X (x coord up), -X (x coord down), +Z, -Z, +X-Z, +X+Z, -X-Z, and -X+Z.
I want to figure out which of these directions the player is facing so that I can derive {X,Z} coordinates that follow linearly in that direction.
For instance, if the player is at {0,0} and facing in the +X+Z direction, I want to find that out in-code and be able to derive the points ({1,1}, {2,2}, {3,3} etc)
Rollback Post to RevisionRollBack
Comic artist, indie game dev, lots of things. Click image to check out my latest comic series?
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)
If you look at the debug screen in minecraft by pressing F3, there is an int labeled with "f" and it has a value between 0 and 3 depending on what way the player is facing. Use that.
If you look at the debug screen in minecraft by pressing F3, there is an int labeled with "f" and it has a value between 0 and 3 depending on what way the player is facing. Use that.
That only gets as specific as the main cardinal directions (N, S, E, W). And I need to figure this out in-code.
Rollback Post to RevisionRollBack
Comic artist, indie game dev, lots of things. Click image to check out my latest comic series?
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)
How could I go about doing that?
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)
There are essentially 8 compass directions the player can face and move in: +X (x coord up), -X (x coord down), +Z, -Z, +X-Z, +X+Z, -X-Z, and -X+Z.
I want to figure out which of these directions the player is facing so that I can derive {X,Z} coordinates that follow linearly in that direction.
For instance, if the player is at {0,0} and facing in the +X+Z direction, I want to find that out in-code and be able to derive the points ({1,1}, {2,2}, {3,3} etc)
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)
That only gets as specific as the main cardinal directions (N, S, E, W). And I need to figure this out in-code.
(Warning: series may be NSFC [Not Safe For Church], viewer discretion is advised)