How do I randomize specific tiles?

0 favourites
  • 2 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • I'm bad at explaining this so I made a quick mockup picture.

    Basically what I want to happen is that since I'm using the flat tiles with no decorations to build my map. I would like to create few tiles with random decorations, as you can see i quickly made with paint for the picture. And when the layout starts for every tile there is a say 1/10 chance to change into a random tile that is the same spot but has decoration on it. You know to make the game look a bit more randomized and not just a big blank box.

    Is this possible to do with C2?

    something like this:

    on layout start if tile is "1"

    change tile to: "choose (1,1,1,1,1,1,1,1,1,2)"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This should work:

    +System: On start of Layout

    +System: For "x" from 0 to Tilemap.Width/32

    +System: For "y" from 0 to Tilemap.Height/32

    +Tilemap: Tile (loopindex("x"), loopindex("y")) = 1 -> Tilemap: Set tile (loopindex("x"), loopindex("y")) to tile choose(1,1,1,1,1,1,1,1,1,2)

    Edit: "32" = size of your Tile - 32x32 in this case

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