• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Not collision with var = Do something...

Hello, I would like to know how do the following: (This script is not working, would like to know how to fix this)

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var Hit = Collision_Place_Meeting(x,y,object);
var Number = 0;
var Sure = 0;

if (Number == 1 && != Hit)
{
Sure = 1;
}
else
{
Sure = 0;
}
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
First, what does the script Collision_Place_Meeting() return= And what is the script?

Second, You declare Number as a local var and set it to 0, so in the If check it will never be equal to 1 as you've set it to 0 already.

Third, the " != Hit" bit is wrong. You need to specify what isn't equal to Hit, eg:
Code:
if (Number == 1 && Number != Hit)

Fourth (and not really an issue, but it's unnecessary code), you declare "Sure" as 0, so there is no need for the "else" statement, as Sure will be 0 already if the "if" returns false.
 
First, what does the script Collision_Place_Meeting() return= And what is the script?

Second, You declare Number as a local var and set it to 0, so in the If check it will never be equal to 1 as you've set it to 0 already.

Third, the " != Hit" bit is wrong. You need to specify what isn't equal to Hit, eg:
Code:
if (Number == 1 && Number != Hit)

Fourth (and not really an issue, but it's unnecessary code), you declare "Sure" as 0, so there is no need for the "else" statement, as Sure will be 0 already if the "if" returns false.
My apologist if I was not clear. I went to fix my post since I found the answer, here is the answer.

---------------------------------------------------------------------------------------------------------------------------------------
Event: Space pressed

Code:
if (vspeed = 0)
{
vspeed = 4
}

Event: Step

vspeed += 0.4;
 
Top