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.x + imgwidth(this.image), this.y + imgheight(this.image))) {
temp.movex = sin(this.angle) * this.speed;
temp.movey = cos(this.angle) * this.speed;
move(movex, movey, .1, 8);
}
}
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?