View Single Post
  #1  
Old 12-22-2009, 05:48 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I'm not sure if move() updated the x and y continually or only when it reaches the end, but you could do like:

PHP Code:
function whatever() {
  
this.move(52100); // delta x, delta y, time, options

If you wanted to call a function when it reached an x of 7, you would just schedule the event for when the x would be 7

Set it up like an equation

PHP Code:
+ (5/10)(t)

+ (5/10)(t)

= (5/10)(t)


then in your function

PHP Code:
function whatever() {
  
this.move(52100); // delta x, delta y, time, options
  
this.scheduleEvent(4"onMyFunction");

(not trying to sound condescending, sorry if it comes off that way)
__________________
Reply With Quote