Preventing the correct sequence in the draw

Get help using Construct 2

Post » Mon Oct 21, 2013 1:47 pm

And the correct position is the one they are created in from left to right? So if it spawns 5 1 2 3 4, you would need to order those cards to 5 1 2 3 4?

How about changing the correct sequence to something else (like a second random generation of 5 invisible sprites on the same positions and later on check if 5 is overlapping invisible 5 and so on)mindfaQ2013-10-21 13:48:40
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 3:01 pm

This game is a logic sequence for children, always from low to high (quantities, sizes, etc) so always from left to right (1,2,3,4,5). No way to prevent only the first card appeared in place of the first sprite6? That would solve the issue now.RenatoB2013-10-21 15:02:47
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Oct 21, 2013 4:09 pm

This should do it:
http://s000.tinyupload.com/index.php?file_id=65265704534428189069

2 new instance variables:
canspawn1: default is 1, set it to 0 for your first sprite where you dont want a 1 to spawn
occupied: default is 0, set it to 1 after it spawned a sprite

If you want to repeat the spawning, you could put all this sprite generation into a function and at the start pick all sprite6 and set occupied to 0 again to free them up. It could look like this: http://s000.tinyupload.com/index.php?file_id=94807792036239360184mindfaQ2013-10-21 16:13:41
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 5:51 pm

Very nice solution. I don't understand why I can't think about it. Thank you so much.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Oct 21, 2013 6:44 pm

@mindfaQ

How can I do to set the variable "canspawn1" to null (<varies>)? When I leave this value blank, the program write "0".
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Oct 21, 2013 7:03 pm

Since I adjusted the variable to 0 to the left-most sprite6, it displays and the other ones have the value 1, it displays <varies>. Set it to 1 for all sprite6s except the first one and you should be fine. If you create a new Sprite6, you might need to define canspawn1 to the specific value you need at that place, but I don't think you need new ones, as you can just set them as invisible.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 7:09 pm

@mindfaQ

Thank you very much. It's everything okay now.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Previous

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, Nicolas951, tarek2 and 6 guests