Thread: Some angle help
View Single Post
  #20  
Old 11-03-2007, 10:57 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
But shouldn't the first onwall (onwall(temp.dx, temp.dy)) still work when it's first hit, then? Because in that case this.anglex and this.angley are exactly the same.

In any case, I just plain ****ed it up...
PHP Code:
function onActionHit(damageaccuracyeffectsaccpxpy) {
  
this.distgone 0;
  
this.angle getangle(px-this.x,py-this.y);
  if (
this.angle degtorad(180))
    
this.angle -= degtorad(180);
  else 
this.angle += degtorad(180);
  
this.velocity = ((damage*4.45)/this.weight)*.05;
  
temp.friction this.weight/damage;
  if (
temp.friction>=1this.dist 0;
  else 
this.dist .75 temp.friction;
  
onTimeOut();
}
function 
onTimeOut() {
  if (
this.distgone this.dist) {
    
temp.this.x+1temp.this.y+1;
    
temp.dx temp.x+(this.velocity*cos(this.angle));
    
temp.dy temp.y+(this.velocity*(-sin(this.angle)));
    if (!
onwall(temp.dxtemp.dy)) {
      
this.temp.dxthis.temp.dy;
      
this.distgone += this.velocity;
      
this.velocity = (this.velocity/5)*4;
    }
    else {
      
temp.bx onwall(temp.bx,temp.y);
      
temp.by onwall(temp.y,temp.by);
      if (
temp.bx && temp.by) {
        if (
this.angle degtorad(180))
          
this.angle -= degtorad(180);
        else 
this.angle += degtorad(180);
      }
      else {
        if (
temp.bxthis.angle pi this.angle;
        if (
temp.bythis.angle = -this.angle;
      }
      
this.velocity = (this.velocity/5)*3;
      
temp.dx temp.x+(this.velocity*cos(this.angle));
      
temp.dy temp.y+(this.velocity*(-sin(this.angle)));
      if (!
onwall(temp.dxtemp.dy)) {
        
this.temp.dxthis.temp.dy;
        
this.distgone += this.velocity;
      }
    }
    if (
this.velocity <= .005this.dist this.distgone 0;
    else 
setTimer(0.05);
  }

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote