View Single Post
  #2  
Old 05-20-2012, 11:37 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
get rid of your else statements.
Have it so it's like this
PHP Code:
if (keydown(0)){

}
else if (
keydown(2)){

}

if (
keydown(1)){

}
else if (
keydown(3)){


I'd also suggest use vecx and y to make your script shorter

PHP Code:
for (temp.i=0;i<4;i++){
  if (
keydown(i)){
    
player.+= vecx(i)*client.playerSpeed;
    
player.+= vecy(i)*client.playerSpeed;
  }

I've intentionally left out the onwall detection for you to do btw so you can understand the concept. Have fun.
Reply With Quote