Randomly picked tiles in background??

Get help using Construct 2

Post » Thu Aug 29, 2013 8:48 pm

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 ;)
B
6
S
2
G
4
Posts: 15
Reputation: 1,183

Post » Thu Aug 29, 2013 11:10 pm

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.
B
3
Posts: 13
Reputation: 303

Post » Sun Sep 01, 2013 3:50 pm

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
B
6
S
2
G
4
Posts: 15
Reputation: 1,183


Return to How do I....?

Who is online

Users browsing this forum: Bootfit, digitalsoapbox, OBLIVION and 25 guests