You may or may not know that I am currently working on a Geometry Dash Engine in Game Lab. I have completed the ship game mode, and have almost completed the cube game mode. I am having trouble getting the cube to stop rotating on whatever side the cube lands on, or the closest side to whatever the cube lands on(if it lands on a corner, the next adjacent side). Anyone know how I can do this?
Cheers,
esw

(Almost) Finished Project Link:

https://studio.code.org/projects/gamelab/VRwAO1Ml4frA_xWYv2Oi62yIQCxqEW9dcLG-TZvG5OE

    7 days later

    esw I actually came up with a solution a while ago and it seems to work well all i had to do was just modify it to Math.floor() i think Fluffypoopo originally asked a question like this

    function angleCap(num){
        return Math.floor(num % 360 / 90) * 90 // we use this instead of Math.round so we get angles that we like
    }
    // demo code
    player.rotationSpeed = 0;
    player.rotation = angleCap(player.rotation); // this kept being put to zero which resets everything

      Varrience @esw uh i showed a fix and it doesn't seem to be implemented... i just wanted to make sure you read this if this is still not efficient enough i can find another way but this was the best shorthand function i came up with

      9 days later

      yooooo geometry dash engine sounds HEAT

      Chat