Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-16-2014, 11:23 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
Move() set x and y

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(13232);
 
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;
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.