2 Replies Latest reply on Aug 6, 2007 4:29 AM by smileInVietnam

    sprite speed


      I Have a 'cloud' sprite with this behavior to make it move across the stage:


      property my
      on exitframe me

      my = sprite(me.spritenum)
      my.loch = my.loch + 1

      if my.loch > 1400 then my.loch = -600

      end if



      i was wondering if there is anyway to make it move slower, about 1/3 of this speed?
      ive tried to lower the framerate but this isn't very smooth.
        • 1. Re: sprite speed
          ddok-zscS6F Level 1
          also this question :]

          i have sprite wich on mousedown moves another sprite via a loch onto the stage. want i want to do is to click this sprite again to move the other sprite of
          the stage again.

          there is probably a easy way to this but im stuck.

          on enterframe me

          on mousedown me

          puppetsound 3,("mapunfold")

          if the mousedown then

          the loch of sprite(53) = 100

          end if


          • 2. Re: sprite speed
            smileInVietnam Level 1
            property pMySprite
            property pDelay

            on beginSprite me
            -- if you want to make it smooder then make higher the framerate.
            -- puppetTempo = 30

            pMySprite = sprite(me.spriteNum)
            pDelay = [:]
            pDelay[#curCount] = 0

            -- if you want to make it slower then use higher number of maxCount
            pDelay[#maxCount] = 3

            on prepareFrame me
            pDelay.curCount = pDelay.curCount + 1
            if pDelay.curCount mod pDelay.maxCount > 0 then exit

            pMySprite.locH = pMySprite.locH + 1

            if pMySprite.locH > 1400 then
            pMySprite.locH = -600
            end if