Sega Saturn Development > General Jo Engine Help

jo_sin_mult/jo_cos_mult return smaller/bigger value



I've been adapting Danny's script to work with a dungeon crawler movement (90 degree turns and fixed step movement) to learn how to manage first person movement. However, jo_sin_mult/jo_cos_mult sometimes return a smaller/bigger value (127 or 129 instead of 128) whenever I try to move on the X or Z axis.

Sorry if that's a stupid question, but I'm learning how the engine works and unfortunately the lack of tutorials on the 3D part makes it somewhat confusing at times.

I've attached the test code


I will answer you as soon as possible :)

I found it! :)

It's an approximation bug that I fixed.

Now, the code bellow works perfectly:

--- Code: ---
void my_gamepad(void) {
    if (jo_is_pad1_key_down(JO_KEY_UP) && !lock) {
        speed += SIZE_UNIT;
    if (jo_is_pad1_key_down(JO_KEY_DOWN) && !lock) {
        speed -= SIZE_UNIT;
    if (jo_is_pad1_key_down(JO_KEY_LEFT) && !lock) {
        tangle -= 90;
    if (jo_is_pad1_key_down(JO_KEY_RIGHT) && !lock) {
        tangle += 90;

--- End code ---

You just need to update the engine :

I know I promised a tutorial about first person movement but I have been busy  :(.
The last code I posted missed the full 3d movement and was not really well structured, sorry about that  :-\.
I will try to make a tutorial this week with a full 3d movement flight camera.

Thanks for the fix! I'll continue working on it.


[0] Message Index

Sitemap 1 2 3 4 5 6 7 8 9 10 
Go to full version