Create random sprites in specific positions

Get help using Construct 2

Post » Wed Oct 16, 2013 1:16 pm

I've only two questions about this solution:

- how can I do to prevent the correct order be randomly selected?

- if I need to use more than one family, containing other members, I'll have to create a process for each one? When I used frames, I can identify which of them would be in each location. Could I control or identify the order of the families members?

ThanksRenatoB2013-10-16 21:56:24
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Thu Oct 17, 2013 1:13 am

If @emoaeden can not answer these questions, could someone do this?
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Thu Oct 17, 2013 7:09 am

can someone post for 146 version..please
B
12
S
1
Posts: 31
Reputation: 607

Post » Thu Oct 17, 2013 7:23 am

You could tell the code that the first X can not have number 1 for example, to ensure it's never easy.

If you want to use frames, then you can use very similar code, instead of using family references, just use frame references, shouldn't be too hard.

Let me have a go, and see what I can do.
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Thu Oct 17, 2013 9:20 am

https://dl.dropboxusercontent.com/u/108799982/Capx%20Demos/RandomSprite1.capx

That's what I came up with, there is an issue with the swapping of the second number to the firsts position, but I'm sure you'll be able to fix it. If not, someone else on the forum can give it a shot.
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Thu Oct 17, 2013 12:07 pm

Thank you, @emoaeden.

I've created the swap code. The idea to prevent that one of the cards do not occupy their home during the draw is interesting, but I think it will be best to prevent that they all stay in the correct formation. Is it possible? Regarding the use of families, from what I understand we cannot identify the members positions (order), right?

Any difference between using families and animations in the game performance? I know how to adapt the code to use frames and I think it would be better because I'll have more control. What do you think?RenatoB2013-10-17 12:14:15
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Thu Oct 17, 2013 9:09 pm

Well, as you can see, I made this one use a sprite and choose the animation, so that's how you would do that.

As for performance, on such a simple game, I'd doubt there would be any noticable difference.

And I think if you used, Pick nth Instance of Family or Pivk by Comparison, you might be able to pick a certain family member.
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Fri Oct 18, 2013 12:06 am

@emoaeden: thanks for all.
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests