Dear List,

--Newbie here--
          My behavior works great for sprites whose original location is
greater than the destination (as far as stopping the animation at the
destination), but when the original position is less than the destination
the animation continues off the screen.  What am I missing?

--script snip

on exitframe me
    Case (pControl) of
      "Move horizontally"
        if (sprite(me.spritenum).loch < pDestination) then
          sprite(me.spritenum).loch = sprite(me.spritenum).loch + pRange
          if (sprite(me.spritenum).loch >= pDestination) then
            sprite(me.spritenum).loch = pDestination
            updateStage
          end if
        else
          sprite(me.spritenum).loch = sprite(me.spritenum).loch + pRange
          if (sprite(me.spritenum).loch <= pDestination) then
            sprite(me.spritenum).loch = pDestination
            updateStage
          end if
        end if
      "Move vertically"
        if (sprite(me.spritenum).locv < pDestination) then
          sprite(me.spritenum).locv = sprite(me.spritenum).locv + pRange
          if (sprite(me.spritenum).locv >= pDestination) then
            sprite(me.spritenum).locv = pDestination
            updateStage
          end if
        else
          sprite(me.spritenum).locv = sprite(me.spritenum).locv + pRange
          if (sprite(me.spritenum).locv <= pDestination) then
            sprite(me.spritenum).locv = pDestination
            updateStage
          end if
        end if

--end script snip

W. Locke Morgan
New Orleans, LA - USA


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to