Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
DM ChangeRes
Select Button With Rollover Effect
Snap Shot Maker
Jump Sprite - Move a sprite along a parabolic arc so it
Change Line Direction of a Shape Cast Member
Button Factory
Importer
Bit Checker
Ripple Rain-Alphamania
CloneIt
MediaMacros Xtras Mall
 

 

 

Behavior Random Sprite Swap

Added on 7/1/1999

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC

This item has not yet been rated

Author: ColeTierney

A behavior that allows sprites to randomly swap positions.

--  Randomize Positions Behavior  --
--     CBT; 5/13/98
--
--  Usage:
--
--   set spriteLocs = []
--   sendAllSprites( #registerCardPositions, spriteLocs )
--   sendAllSprites( #takeRandomCardPosition, spriteLocs )
--
------------------------------------
property spriteNum

on registerCardPositions me, positions  
  add positions, the loc of sprite spriteNum
end

on takeRandomCardPosition me, positions  
  set pCount = count( positions )
  set myPos = random( pCount )
  
  set the loc of sprite spriteNum = getAt( positions, myPos )
  deleteAt( positions, myPos )
end

on getBehaviorDescription
  return "Allows sprite to randomly change positions with other sprites."
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail