Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Rollover Toolkit
SendAppleEvent
Director 7 and Lingo Bible
Color Fader-Alphamania
Side Scroller
Play/ Pause/ Rewind/ StepForward/ StepBackward Video Sprite
Billenium Transitions Xtra v1.3
Cursor Trails
cXtraCalendar
Image Magnify
 

 

 

Behavior Sprite Group Movement behavior

Added on 6/10/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: RettCrocker

Sprite Group Movement behavior

property spriteNum
property pGroupName, pMouseLoc

on mouseDown me
  set pMouseLoc = point(the mouseH, the mouseV)
  add the actorList, me
end

on mouseUp me
  deleteOne the actorList, me
end

on mouseUpOutside me
  deleteOne the actorList, me
end

on stepFrame me
  set lNewLoc = point(the mouseH, the mouseV)
  set lOffset = lNewLoc - pMouseLoc
  set pMouseLoc = lNewLoc
  sendAllSprites(#moveMyself_SGM, pGroupName, lOffset)
end

on moveMyself_SGM objRef, lPassedGroup, lOffset
  if lPassedGroup = pGroupName then
    set the loc of sprite spriteNum = (the loc of sprite spriteNum) + lOffset
  end if
end

on getPropertyDescriptionList
  set description = [:]
  addProp description,#pGroupName,[#default:"", #format:#string,#comment:"Group Name:"]
  return description
end

on getBehaviorDescription
  set lText = ""
  put "--======= Sprite Group Movement behavior =======--" & RETURN after lText
  put "This behavior, allows multiple sprites to move as if " after lText
  put "they are one.  Each sprite with this behavior and the " after lText
  put "same group name will move together whenever clicked " after lText
  put "and dragged.  Try it.  You"ll see." & RETURN & RETURN after lText
  put "As always, if you use this behavior I would " after lText
  put "like a mention in your credits.  Enjoy." & RETURN & RETURN after lText
  put "--== © Rett Crocker 1997" & RETURN after lText
  put "    --==  rett@zapgun.com" & RETURN after lText
  put "        --==  www.zapgun.com" & RETURN after lText
  return lText
end  

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail