Thread: simple movement
View Single Post
  #1  
Old 02-18-2012, 03:01 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
simple movement

im trying to set a simple movement within a level area but it keeps heading up to the top of the gmap instead of staying in the level and doing the random movements.
PHP Code:
function onCreated(){
  
showcharacter();
  
setcharani ("ghostani",NULL);
  
dontblock();
  
this.speed 8;
  
this.options 8+16;
  
startmove();
}
function 
startmove() {
  
this.newx=random(1,63);
  
this.newy=random(1,63);
  
dx=(this.newx-x);
  
dy=(this.newy-y);
  
this.distance = ((this.newy-y)^2+(this.newx-x)^2)^.5;
  
this.time = (this.distance/this.speed);
  
move(dx,dy,this.time,this.options);
}
function 
onMvementFinished) {
  
startmove();

__________________
account was being used by jigga.... sorry for what he has said in the past
Reply With Quote