instead of
Code:
if ( Button1 == 1 )
{
Target = 200 ;
}
else if ( Button2 == 1 )
{
Target = 400 ;
}
else if ( Button3 == 1 )
{
Target = 600 ;
}
i would do this
Code:
if ( (Button1 * Button2) + (Button2 * Button3) + (Button3 * Button1) + ( Button1 + Button2 + Button3 ) == 1 ) //prevents crazy values if more than one button is pressed and keeps the same value if no button is pressed
{
Target = (Button1 * 200) + (Button2 * 400) + (Button3 * 600)
}
this just makes more sense to me and I just post it here for any like minded people out there. I think it takes a little less cpu time too.