Hey all. I have a platform that moves in my platform game and I am currently having problems with its moving script.
onClipEvent(load){
movedir="up";
Ystart = this._y;
Ystop = this._y-5;
}
onClipEvent(enterFrame){
//Ystart
if(this._y==Ystart){
movedir="up";
}else if(this._y==Ystop){
movedir="down";
}
if(movedir=="up"){
this._y-=5;
}else if(movedir=="down"){
this._y+=5;
}
}
What I thought this should be doing is move up if it hits Ystart and move down when it hits Ystop. But so far it only goes up and wont recoganize Ystop. Any ideas or see anything I should fix?