As title says, I'm just looking for opinons on this code. If it's unreadable (mainly), takes too much memory whatever. (So long as it's helpful of course..)
Take note, i might ask questions.
PHP Code:
//#CLIENTSIDE
function onCreated(){
this.boots = false;
this.speed = 2;
}
function onKeyPressed(code, key){
if(key == "b"){
if(this.boots == false){
this.boots = true;
}
else if(this.boots == true){
this.boots = false;
}
if(this.boots == false){
player.chat = "Boots off!";
}
else if(this.boots == true){
player.chat = "Boots on!";
setTimer(0.05);
}
}
}
function onTimeout() {
if (this.boots == true) {
for ( temp.key = 0; key < 4; key++) {
if(keydown(key)){
player.x += vecx (key) * this.speed;
player.y += vecy (key) * this.speed;
}
}
setTimer(0.05);
}
}