View Single Post
  #43  
Old 12-25-2007, 01:11 AM
Rapidwolve24 Rapidwolve24 is offline
North*
Join Date: Oct 2007
Location: Massachusetts
Posts: 178
Rapidwolve24 is on a distinguished road
Send a message via AIM to Rapidwolve24 Send a message via MSN to Rapidwolve24
I know I'm a little late but wouldnt something like this do the trick

PHP Code:
public function CheckPath(xydxdy)
{   
   
temp.check 0;
   
temp.checkrate 1;
   
   
temp.distance distance(xydxdy);
   
temp.angle getangle(dx xdy y);
   
   while (
temp.check temp.distance)
   {
     
temp.checkx int(+ (temp.check cos(temp.angle)));
     
temp.checky int(+ (temp.check * -sin(temp.angle)));
     
     if (
onwall(temp.checkxtemp.checky))
     {
        
temp.onwallcounter += 1;
     }
   
     
temp.check += temp.checkrate;
     
     
sleep(0.05);
   } 
  return 
temp.onwallcounter;

Reply With Quote