This is going to be pretty short ;)
this is just a simple technique to save you time and make your 'if's look neater
we rely on the fact that a logical 'true' is equal to 1 and a logical 'false' is equal to 0
for example, let's examine the following situation, we have acceliration in a game and we want it to move towerds 0, now our normal solution would have been
if(object.accel>0){
object.accel--;
}
now let's count on the fact that the '>' operator is a boolean operator, it's either "true" or "false" which as I already said equals to '1' and '0'
therefor we can write it now as
object.accel-=(object.accel>0);
now let's say we want it to increase by two, all we have to do is
object.accel+=(object.accel)*2;
simple eh?
now let's say we want it to increase if they key "down" is pressed
object.accel+=(Key.isDown(Key.DOWN));
nifty ain't it?