2 Replies Latest reply on Jan 21, 2007 2:24 PM by Dava

    Drag & Drop Game - I'm stuck!

    Dava
      Hello.

      I'll try and explain this as simply as I can!

      I have a drag and drop game where you have to drag one of 4 items into a bag. If you chose the right item and drag that into the bag, you'll jump to a specific marker which says CORRECT. If you drag any of the other 3 items, you'll jump to a marker that says FALSE. In other words, for each item I need it to jump to a different marker when you've dragged it in.

      At the moment I've managed to get it working so it jumps to the marker, but it jumps to the same marker which ever item you drag. I need them to be different.

      >> I HAVE THIS SCRIPT ON MY DRAGGABLE ITEM:

      end beginSprite

      on endSprite(me)
      (the actorList).deleteOne(me)
      end endSprite

      on mouseDown me
      pOffset = pSprite.loc - the mouseLoc
      (the actorList).append(me)
      end

      on stepFrame(me)
      if the mouseDown then
      pSprite.loc = pOffset + the mouseLoc

      else
      sendAllSprites(#DropSprite, the mouseLoc)
      pSprite.loc = pStartLoc
      (the actorList).deleteOne(me)
      end if
      end stepFrame


      >> I HAVE THIS SCRIPT ON MY TARGET AREA (BAG):

      property marker

      on DropSprite(me, aLoc)
      vSprite = sprite(me.spriteNum)
      vRect = vSprite.rect

      if aLoc.inside(vRect) then
      go marker
      end if
      end DropSprite

      on getPropertyDescriptionList(me)
      vPropertyList = [:]

      vPropertyList[ \
      #marker] = [ \
      #comment: "Marker to jump to when DropSprite is called", \
      #format: #marker, \
      #default: marker(1)]

      return vPropertyList
      end getPropertyDescriptionList





      Any help would be greatly appreciated! Thank you.