How do I .. disable certain things??

Get help using Construct 2

Post » Thu May 12, 2016 11:17 am

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. :D

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.
B
3
Posts: 2
Reputation: 180

Post » Thu May 12, 2016 1:36 pm

Hi,

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? ;)

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.
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
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu May 12, 2016 2:09 pm

Thank you very much for your reply!
Oh yea ofcourse dropbox links.. :oops: :D

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 :shock: 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 :)

Kind Regards,
Lydia
B
3
Posts: 2
Reputation: 180


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, luckyrawatlucky and 21 guests