i beg you.

Out of context: Reply #7

  • Started
  • Last post
  • 7 Responses
  • beingdevious0

    hmm well. think of it this way..
    take 10 and divide it by 2
    5 div by 2 again
    2.5
    again..
    1.25
    if you keep dividing the result by 2, you wil;l *theoretically* never reach 0 you will reach a very small decimal however..say 0.00000000001

    your moving the xpos of Object

    with (object) {
    _x-=_x(_x-finalDest)/constant
    }

    check to see if object._x is less than say 0.5 if it is, turn on a variable and use the variable as a switcher.

    therfore the code youre executing is in an if statement on the enterframe.

    doTheCode=true

    this.onenterframe=function(){
    if (doTheCode) {
    execute this;
    }
    }
    inside the execution set, turn the variable off(false) and set the variabel initially to true.

    if your doing multiple things, make a multi state variable
    dotheCode=1, 2, or 3
    if doTheCode==1){
    do this
    }else if (dothecode==2) {
    do 2nd
    }...

    you get the idea

View thread