I have been messing around with alternate ways to move my "bullet."
I have been using the move() function a little bit but I cannot get it accurate.
PHP Code:
function onCreated(){
setImg("blackbeltben_bullet.png");
setShape(1, 32, 32);
onTimeOut();
scheduleEvent(5, "onDelete");
//the new x and y were set in the putNPC
this.newx = this.newx
this.newy = this.newy
//in this case, the newx and newy were set as the curret mousex and mousey at the point of the creation
}
function onTimeOut(){
setTimer(0.1);
//Here I'd like it to move to this.newx, this.newy
}
function onDelete(){
destroy();
}
If I am using a move(), I should not be putting it in a timeOut. But I'm assuming that there is no way to set a specific x and y with move().
With that being said, I'm guessing I have to calculate how much the x and y need to be increased/decreased... Which I am not sure how to do..
straight to the point
I want my NPC to move directly to this.newx, this.newy at a speed of 0.5;