Quote:
Originally Posted by fragman85
I just slipped throught it, but here some small tips:
Instead of:
if(blabla == 0) you can use if (!blabla)
Oh and also, instead of:
PHP Code:
if (keydown(1)) {
this.dir = 1;
}
if (keydown(2)) {
this.dir = 2;
}
if (keydown(3)) {
this.dir = 3;
}
if (keydown(0)) {
this.dir = 4;
}
you can use:
PHP Code:
for (i=0; i<4; i++) {
if (keydown(i)) {
this.dir = i;
}
}
|
Ahh, thanks, I'll do that next time.
Quote:
Originally Posted by xXziroXx
Instead of doing...
PHP Code:
this.on = 1;
this.on = 0;
... I'd suggest doing ...
PHP Code:
this.on = true;
this.on = false;
It just looks cleaner to me.
|
Guess that one is preference, I've always used 0 and 1s instead of booleans where I could. Though it is noted and I appreciate the reply.