Thread: Onwall-Check
View Single Post
  #1  
Old 11-22-2008, 09:26 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Onwall-Check

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
setTimer(0.05);
}
function 
onTimeOut() {
  for (
temp.i = 0; i < 4; i++) { 
    if (!
keydown(i)) 
      continue;
    
temp.nOnwall = true; 
    for (
temp.n = 0; n < 8; n++) { 
      for (
temp.k = -1; k < 1; k += 1 / 16) { 
        
temp.onwall = onwall(player.x + 1.5 + vecx(player.dir) * 17 / 16 + abs(vecy(player.dir)) * k, player.y + 2 + vecy(player.dir) * 17 / 16 + abs(vecx(player.dir)) * k);  
        if (
temp.onwall) { 
          
temp.nOnwall = false; 
          break; 
        } 
      } 
       if (
temp.nOnwall) { 
        
player.x += vecx(player.dir) * 1/16; 
        
player.y += vecy(player.dir) * 1/16; 
      } 
    } 
  }  
  
setTimer(0.05);  
} 
Hello.. some people told me that this script is not logical and that I have to do this and that. But no one has ever told me WHY it is not logical or WHAT my mistake is.
I dont want you to rescript this or anything like that.
Please tell me what wrong is Thanks.

Last edited by Pelikano; 11-22-2008 at 10:26 PM..
Reply With Quote