1 Reply Latest reply on May 27, 2008 11:47 AM by multiduck

    Getting the Sprite to follow the cursor

    Sprog89
      Hey there, Im new to this whole thing,
      I was wondering if anyone knew how to make a sprite follow the cursor round the page.
      Also.. i have made some bubbles and somehow want them to pop when another sprite hits them.. anyone help? Btw, its for a project im doing at uni and i havent got long, i know im stupid for leaving it till now but had so many deadlines as of late. Thanks.
        • 1. Getting the Sprite to follow the cursor
          multiduck Level 1
          If you are on a tight deadline you can use the behaviors that comes with director, first place two sprites on stage one that's either invisible or don't look strange when it's under the cursor all the time, and then the one you want to follow the cursor.

          On the first sprite attach from the library the behavior animation - interactive - "sprite track mouse", on the other sprite attach from the same library "Follow Sprite". Tweak the options for best effect.

          For the pop you'll have to write your own behavior that includes the following and have a bitmap member that shows a popped bubble.

          on enterframe me
          if sprite(me.sprienum).intersects(sprite2) then
          sprite(me.spritnum).member=member("bubble_popped")
          end if
          end

          If you want an animated bubble pop it may be faster to use an animated gif, or you can use a movie clip, or step through the frames in the behvior.