Preventing the correct sequence in the draw

0 favourites
  • <img src="http://img600.imageshack.us/img600/8039/lkqa.png" border="0" />

    How to prevent the display of the correct sequence?

    I've tried using a verifier UID, but failed.

    Thanks

  • What do you mean by preventing the display of the correct sequence? That 5 4 3 2 1 are spawned in random order?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes. Prevent the spawned the right sequence (1,2,3,4,5) in the same order of the Sprite6 instances. If I prevent to show card #1 in the first Sprite6 (UID #1), would be a basic solution.

    I tried to use UID to detect the first sprite:

    X Sprite6 => RandomNumber = 1

              => (invert)Sprite6.UID = 1

    In this case, when this "Sprite6 - UID #1" instance is drawn and the card #1 is spawned, the slot appears empty.

  • Some help?

  • Please, some help. Just missing this detail so that I finish the game. I just need some suggestions and, if possible, with some explanations. Thanks.

  • I still don't fully understand what is happening, sorry.

    Can you explain step by step what is happening? And what should happen instead?

    I see that you destroy the sprites 1-5 that are there. Then it gets blurry, because we don't know how many sprite 6 there are, what the default value of random number is (guess 0), where repeat count is set back to 5, if random number is set back to 0 after a sprite1-5 has been spawned, etc..

    Basically don't know how you handle the variables that seed into the random distribution of your event.

  • mindfaQ

    Look at the original file: dl.dropboxusercontent.com/u/108799982/Capx%20Demos/RandomSprite.capx

    I used the basic idea to create my game. This projet was created by another user. In this CAPX, the sprites are not arranged side by side, but try to imagine them in this way. I want to know how to prevent the correct order is shown on the screen, ie, avoid the game to be solved in the draw.

  • Hmmm, wouldn't that mean you would need to conceal either the random cards at top (so that you don't see their number) or the required sequence on the bottom?

    Like give each sprite a second frame that shows the same card back for every card, set animation speed to 0. Then when the card is laid down, set frame to 1. Then when you want the number of the card to be revealed, for example when it is successfully laid on the correct number, set frame number to 0.

  • You really don't understand, but thanks anyway.

    These cards appears open and the player has to must put them each one in the correct order. On my game, he needs to swaping these cards. I just need to make at least one of these cards never appear in the correct position, after the draw, so the sequence is not completed automatically.

  • 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)

  • 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.

  • This should do it:

    s000.tinyupload.com/index.php

    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: s000.tinyupload.com/index.php

  • Very nice solution. I don't understand why I can't think about it. Thank you so much.

  • mindfaQ

    How can I do to set the variable "canspawn1" to null (<varies>)? When I leave this value blank, the program write "0".

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)