Jump to content

I am wondering if it is possible to have a function that takes 3 booleans and each one is related to a sprite, (this is for a matching game btw) and in it you be able to say which sprite was the one you wanted to be correct by say true in the function param and you would just say the others were false. So is there any way to do that and how?

Link to comment
https://linustechtips.com/topic/433116-javascript-collision-detection/
Share on other sites

Link to post
Share on other sites

Your question is not clear. Are you asking about collision detection or general programming in JavaScript?

ok, this is what  I have so far and it does not work and I am trying to fugure out how to make it so that when you have S1 true and if you then have a diffrent sprites x equal to the one of S1 it says game over.

correct(true,false,false);
    function correct(S1,S2,S3){
        SC1 = new Boolean(S1);
        SC2 = new Boolean(S2);
        SC3= new Boolean(S3);
        if (S1 === true){
           console.log("S1");
           
           
        }
    }
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×