How do can I create patterns

Get help using Construct 2

Post » Thu Mar 12, 2015 9:07 pm

Can anyone guide me in the right direction?

What's the best way to generate a pattern like this using one square object?

Thanks!
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 10
Reputation: 269

Post » Thu Mar 12, 2015 9:39 pm

x+1*tilewidth
y+1*tileheight
x-1*tilewidth
y-1*tileheight

Given that you want to place squares around the center tile, clockwise.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Fri Mar 13, 2015 11:28 am

That helped. Thanks Newt!
B
5
Posts: 10
Reputation: 269

Post » Fri Mar 13, 2015 1:21 pm

Alternatively we can use loop with simple math
You do not have the required permissions to view the files attached to this post.
ImageImage
B
115
S
51
G
24
Posts: 790
Reputation: 23,505

Post » Fri Mar 13, 2015 1:27 pm

Ok. So how can I create a random sequence of blocks in different patterns each time the games starts?

For example:
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 10
Reputation: 269

Post » Fri Mar 13, 2015 2:30 pm

Hi,

you could make the code for each sequence you need and use a round(random(0,X)).
So when round(random(0,X)) = 1 you could call the code for sequence 1...
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Sat Mar 14, 2015 1:42 pm

Just like what @beufreecasse said and my following suggestion.
Take a look at the topic below to generate random pattern:
viewtopic.php?f=147&t=122780&p=874648#p874648

You just need to adjust the variable maxRoomSize to fit your needs.
ImageImage
B
115
S
51
G
24
Posts: 790
Reputation: 23,505

Post » Sun Mar 15, 2015 4:59 pm

Thanks. You guys are awesome! alextro that last tip is similar to what I looking for. I can work with that!!!
B
5
Posts: 10
Reputation: 269

Post » Fri Mar 20, 2015 5:22 pm

@alextro, if you don't mind can you explain what the events are doing. And what if I want to generate just 10 different unique patterns?

Thanks.
B
5
Posts: 10
Reputation: 269

Post » Fri Mar 20, 2015 6:55 pm

I have an issue submitting an attachment, so take a look screenshot below.

Here you go:
Image

Just add < RoomTile | spawn sensor > in first event and duplicate the RoomTiles in layout as much as you needed
ImageImage
B
115
S
51
G
24
Posts: 790
Reputation: 23,505

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 22 guests