View Single Post
  #4  
Old 12-16-2008, 08:36 AM
thatdwarf thatdwarf is offline
Former UN Dev Admin
Join Date: Nov 2005
Posts: 42
thatdwarf is on a distinguished road
Ok this thread title summarizes my problem, so I will post here too (sorry for the thread steal codein <3)

PHP Code:
function onCreated() {
  
this.image "block.png";
  
setTimer(2);
  
onMovementFinished();
}
function 
onMovementFinished() {
  if(!
onwall(this.imgwidth(this.image), this.imgheight(this.image))) {
    
temp.movex sin(this.angle) * this.speed;
    
temp.movey cos(this.angle) * this.speed;
    
move(movexmovey.18);
  }
}

function 
onTimeout() {
  
destroy();

for the record, this.angle and this.speed are being set in a weapon NPC calling this class
this.angle = getangle(vecx(player.dir), vecy(player.dir));
this.speed = .5;

the move angle goes into an extremely different angle when fired

Suggestions?
Reply With Quote