dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Different sized tiles auto fill grid ??? Brain Hurts.

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    102

    Different sized tiles auto fill grid ??? Brain Hurts.

    I have a situation where I need to fill a grid with tiles that will be of different sizes, but all multiples of a base unit size. Can anyone point me to an example of this already implemented, or some actionscript examples?

    Here is a more detailed explanation of what I'm doing.
    You would have a grid that is of n units wide by n units tall. Then tiles that are also n units wide by n units tall. I want to then give a function a random number of tiles to place into the grid, without having any tiles overlap. It will then place a tile at a random position on the grid, but not in any grid cells that have already been covered by a tile.

    I have been searching google, but I can't seem to find anything that applies.

    Thanks for any help.
    0knowledge

  2. #2
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    If you need a specified number of tiles it depends on the kind of look you want.

    Two simple thoughts that come to mind would be filling with 1x1 tiles and then merging them until you get the right number of tiles.
    Another would be to fill with a small number of big tiles and then divide them randomly until you get the right number.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

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