Spritr follow mouse with delay..???

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default Spritr follow mouse with delay..???

    This is actually for my roomate, and I'm trying to get rid of his defeatist
    attitude...

    Can anyone help me with a script or command to have a sprite follow the mouse
    cursor, with a Delay.....so basically, it would be as though the sprite were
    "chasing" the mouse arrow....slow or regular speed, it wouldn't matter...

    Thanks in advance to anyone who can help!

    OrganicJerk_1 Guest

  2. Similar Questions and Discussions

    1. model to follow mouse
      Hi I am creating a shooting game in director 3d. I hve a gun pointer which i want to move along with the mouse. The problem i am facing is i am not...
    2. 3d object to follow the mouse
      Hi, anyone know how I can get a 3d model to follow the x,y of the mouse. I need the coordinates translated into 3d.. John
    3. Please help with follow mouse!
      Hello I have a menu with a movie clip that slides following the mouse, up and down The code looks as follows onClipEvent (load) _y = 0 speed =...
    4. mouse follow problem
      my prob: have got a bmp. that zooms on click want 2 have it on click to "move" with a mouse follow 2! it shall move only slowly the prob:
    5. Follow Mouse script?
      Hello, I'm making a navigation bar like on http://www.solangemusic.com/ Could someone tell me the script to make the box move with the mouse?...
  3. #2

    Default Re: Spritr follow mouse with delay..???

    -- Here's a behavior for what you described


    -- follow mouse with log

    property lagFIFO

    on beginSprite
    lagFIFO = []
    end

    on prepareFrame me
    -- the 10 below establshes the number of frames delay
    if count(lagFIFO) >= 10 then deleteAt lagFIFO, count(lagFIFO)
    addAt lagFIFO, 1, the mouseLoc
    sprite(me.spriteNum).loc = lagFIFO[count(lagFIFO)]
    if optiondown() then put lagFIFO
    end





    -- this is probably more like what is needed
    -- ( no mass momentum in this simple one )


    -- weak mouse atraction

    on prepareFrame me
    -- 5 is the lag factor
    sprite(me.spriteNum).loc = sprite(me.spriteNum).loc + ( the mouseLoc
    - sprite(me.spriteNum).loc) / 5
    end
    JB Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139