Randomly picked tiles in background??

0 favourites
  • 3 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello

    This is my first post on forum and wan't to say I love the C2 ;)

    To my question:

    Im trying to create a background with three diferent tiles but I want them to be random picked so my background will be randomly created. My tiles are 96x96px. I tryed with tiled background but can't make it happen because you can only pick one tile.

    For better understanding: I have a stone tiles but if I create tiled bckg. my background looks wery borring so I want to add two (or one even)diferent stone tile look so it will be more interesting.

    They should be mixed randomly.

    Can this be done?

    Hope u understand what I mean.

    Thx in advance ;)

  • Yes you can, just replace your backgroundTile object by a sprite.

    With sprites, you can chose different animations or frames of an animation. Create a few grass tiles in the grass animation, create a private variable for that object called "skin", set skin to floor(random(N)) on creation, with N being the last frame you got +1.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply

    Im not following you here :o

    With sprites, you can chose different animations or frames of an animation. (I get that)

    Create a few grass tiles in the grass animation, (grass??, you mean stone?)

    create a private variable for that object called "skin", set skin to floor(random(N)) on creation, with N being the last frame you got +1. (I dont understand that part)

    Where do I put that and how do create private variable u mean instance variable? Why floor?

    Sry I know, Im new to this but somehow I don't get your anwser. Is there maybe any caps for this already?

    Thank you

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