[SOLVED]How do I pseudorandomness?

Get help using Construct 2

Post » Sun Jan 10, 2016 9:38 pm

bump.
Last edited by VIKINGS on Tue Jan 12, 2016 12:35 am, edited 1 time in total.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Tue Jan 12, 2016 12:34 am

Ok, here's a question @LittleStain , @R0J0hound , and everyone else.
What if I take each frame and make it a separate object on it's own? Would that make things easier, could I then put them in an array and do that random thing or what?
And would that have any drawbacks, specially performance wise?
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Tue Jan 12, 2016 7:56 am

Here's a simplified capx that most of the time creates all the combinations without two of the same type next to each other. It uses an array that stores all the combinations with some text like "sprite:0". Then the array is shuffled by swapping values while trying to keep each two of the same type from being next to each other.

https://dl.dropboxusercontent.com/u/542 ... ndom2.capx

As far as moving the objects or using families, you can do anything you like there. All this does is create the objects. Think of the "create" function as a create action with a family as a parameter, only this follows your controlled random requirement.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Jan 12, 2016 11:46 am

Looks awesome @R0J0hound . I'll go with it, thank you very much.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest