Hi.
I want write the script that Each Right key is down change opacity my sprites.
I wrote this script and work very well but I think this way is not correct.I use count++ for delay but when I hold down Right key and count = 10 change my Next sprite opacity. Now I want Each Right key is down and release, change opacity my sprites. already i wrote some script like this (with Boolean) but I don't know why don't work with Boolean.
Thanks
I want write the script that Each Right key is down change opacity my sprites.
I wrote this script and work very well but I think this way is not correct.I use count++ for delay but when I hold down Right key and count = 10 change my Next sprite opacity. Now I want Each Right key is down and release, change opacity my sprites. already i wrote some script like this (with Boolean) but I don't know why don't work with Boolean.
Code: [Select]
int SelectedColor = IN_330;
int move = 1;
int count = 0;
void Main()
{
if (iKeyDown(iKeyCode("DIK_RIGHT")) && SelectedColor == 1 && move == 1)
{
move = 2;
}
if (move == 2)
{
OUT_66 = 0.02;
OUT_88 = 1;
}
if (iKeyDown(iKeyCode("DIK_RIGHT")) && SelectedColor == 1 && move == 2)
{
count ++;
if (count == 10)
{
move = 3;
}
}
if (move == 3)
{
OUT_66 = 1;
OUT_88 = 0.02;
OUT_132 = 0.02;
OUT_154 = 1;
count = 0;
}
Thanks