A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Clumping + clustering

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    1

    Clumping + clustering

    I am trying to use Jim Bumgardner's Clumping example (http://www.krazydad.com/bestiary/bestiary_clumping.html) to create an interface.

    Part of it is that I am creating clusters of bubbles (one parent bubble with n child bubbles). The child bubbles all follow the parent, so far so good.

    Next step is to create a random distribution of these clusters. So the clusters all need to be n pixels away from each other. My idea was to build this into the clumping algorithm. I.e. if one parent is too close to another parent, their x and y will increase/decrease with a value.

    Also I am trying to let the clusters stay in the boundary of the stage. Simply by adding to the algorithm the bubbles should move n pixels to the left when they are too close to the left border of the stage (same principle for the other 3 sides).

    Problem is that it kind of not works what I am trying. I extended the algorithm so far that it became a mess difficult to see what's going wrong (see attachment).

    Can somebody help me with describing how I can improve the Clumping algorithm so that it meets my requirements (1. Clusters distributed randomly, 2. Stage boundary collision)? Pseudo-code is also okay
    Attached Files Attached Files

  2. #2
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    unexpected file format
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center