A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Randomly Position MoveClip without Overlapping?

Threaded View

  1. #9
    Junior Member
    Join Date
    Dec 2012
    Posts
    21
    I'm not really sure what would cause the overlap in terms of size. The objects (is that the right word?) are 155 x 69 pixels in terms of size.

    I have uploaded my rough file if you want to have a look. Ignore the blue fish, its the orange fish that appear that are randomised.

    The code to make them appear is:
    Code:
    var container:Sprite = new Sprite();
    addChild(container);
    container.x = 300;
    container.y = 400;
    
    var food:food_mc = new food_mc();
    container.addChild(food);
    food.x = Math.random();
    food.y = Math.random();
    
    var food1:food_mc = new food_mc();
    container.addChild(food1);
    food1.x = Math.random()*200;
    food1.y = Math.random()*200;
    
    var food2:food_mc = new food_mc();
    container.addChild(food2);
    food2.x = Math.random()*300;
    food2.y = Math.random()*300;
    
    var food3:food_mc = new food_mc();
    container.addChild(food3);
    food3.x = Math.random()*475;
    food3.y = Math.random()*350;
    
    var food4:food_mc = new food_mc();
    container.addChild(food4);
    food4.x = Math.random()*475;
    food4.y = Math.random()*350;
    
    var food5:food_mc = new food_mc();
    container.addChild(food5);
    food5.x = Math.random()*475;
    food5.y = Math.random()*350;
    
    var food6:food_mc = new food_mc();
    container.addChild(food6);
    food6.x = Math.random()*475;
    food6.y = Math.random()*350;
    and is in frame 40.

    Do you know where I could find someone who could sort this out for me and how much it might cost?

    Thanks for your help.
    Attached Files Attached Files

Tags for this Thread

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