How do I make an array map (0s and 1s) with a procedural map

0 favourites
  • 3 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • [SOLVED]

    I can generate rooms randomly and stick them into a tile grid (16px by 16px).

    Now I want to record it into an array using some kind of stepping sprite.

    For example, I spawn a sprite the same size as the tiles I want it to be (16px by 16px), then I check to see if it overlaps a room.

    0 for nothing, 1 for room.

    I move it over by 16px.

    Once it reaches the end, I move the sprite down 16px and repeat the process.

    Can I do some thing like this?

    Project Demo: Generating Rooms

    https:// dl.dropboxusercontent. com/u/103945751/PhysicsProceduralGeneration/index.html

    -Can't post links yet-

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Now I want to record it into an array using some kind of stepping sprite.

    For example, I spawn a sprite the same size as the tiles I want it to be (16px by 16px), then I check to see if it overlaps a room. ..0 for nothing, 1 for room. ..I move it over by 16px.

    Once it reaches the end, I move the sprite down 16px and repeat the process.

    I think....

    You described something....

    like this:

    Stepping sprite.capx

    ..but of course I could be wrong...

  • Thanks so much. It worked.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)