How do I .. disable certain things??

0 favourites
  • 3 posts
  • Hi guys!

    I am a very veeery new beginner to construct. I am not using construct to create a platform game, but for my graduation project. I am making a ''tool'' regarding character development. I won't put down the whole story behind, it but really direct to the problem I have.

    I have made screenshots but I have no clue how to include them to this post... Bit silly I guess. But I will try to explain my problem with words.

    I have 5 sprites (I desiged them in cards) in a row with characters on it. The are all clickable. When I click on one card, all the other cards move behind the one I clicked on, so it shows only the character the user chose. I wantd to create the effect that the cards shove together because it kinda ''cardlike'' to do hehe.. So I gave the other cards the order to move their position ( with tween ) to the same coordinates as the card I clicked on. They are lying behind the clicked on card. So that works all fine. But whenever I click again on the card that I initially clicked on.. the whole thing goes wrong and all the coordinates are screwed up. I think that's because the cards behind the one I clicked on are still clickable even the are behind the other card.

    So the question I had... Is there a way to disable the other cards behind the chosen one for a moment? If i say that those cards should be invisable than the sprites just disappear at once.. and then they will not use the tween to move their position, so they don't shove together anymore.(I would like to keep that because it gives some '' extra'' to it al and it's all not so abruptly).

    I really reaallyy hope some gets at all what I am trying to say without the images.. I can images it does not make sense at all. But if this make sense to somebody and that somebody can help me out I would be very greatfull!!

    Kind regards,

    Lydia Lindeijer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    [quote:3jextksf]I have made screenshots but I have no clue how to include them to this post... Bit silly I guess. But I will try to explain my problem with words.

    Try imgur or dropbox link, perhap? <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    [quote:3jextksf]So the question I had... Is there a way to disable the other cards behind the chosen one for a moment?

    Assuming your logic is correct and the order of the card is at fault, what event are you using to do this? On Object Clicked or On Click? On Object Clicked will go for all objects. I've tried creating 3 Sprites on top of each other and I have this event:

    On Click Sprite -> Sprite.X = random(500)

    When I click on a Sprite, all Sprites go into random x location. One possible fix for this is to use the condition: pick top/bottom.

    [quote:3jextksf]Pick top/bottom

    Pick either the top-most or bottom-most instance, taking in to account layers and Z index. For example, the instance at the front of the top most layer is the top instance.

    Source: https://www.scirra.com/manual/131/common-conditions

    I've tried insert this condition right into the On Click Sprite event and only the Sprite on top will be selected and moved to a random x location, leaving all other Sprites as they are.

    Does this fix your problem?

    Kind Regards,

    TwinBlazar

  • Thank you very much for your reply!

    Oh yea ofcourse dropbox links.. <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed"> <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Oke I have three links here

    First:

    https://www.dropbox.com/s/ob4u61bk6pcan7o/1.png?dl=0

    Here is how the cards are on a row.. to show them al.

    The Second:

    https://www.dropbox.com/s/fhdlsobsivki1w6/2.png?dl=0

    Here is how one is selected.. So know he shows the second card. The rest ''swooshed'' ( you know with the litetween) behind this card.

    Third:

    https://www.dropbox.com/home?preview=3.png

    Here is shows what happens if a click that card again <img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked"> Now the 4th card is suddendly '' selected'' and the 3th card does not know what to do with himself anymore haha.

    I indeed use on click object.. well actually on tap because I also want to run it on a tablet later on. Because I have a lot of objects which can be clicked on, with every card/character clicked their specifiek specs come on screen.

    I am definitely going try your suggestion! Maybe that will indeed be the solution! Thank you for the suggestion <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Kind Regards,

    Lydia

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