How do I choose another sprite

Get help using Construct 2

Post » Tue Oct 27, 2015 9:18 am

Hi.

If I have two of one sprite on my layer, and touch one of them, the boolean for this sprite will be set to "true".
But If I now touch the other sprite, the boolean on this sprite also be set to "true".

How do I set the first touched sprite to boolean "false", when I touch the second sprite?

It is only one sprite, but I have placed two of the same sprite on the layer.
There must only be one af the sprites on boolean "true" at the same time.

Please help, thanks :)
B
5
Posts: 31
Reputation: 361

Post » Tue Oct 27, 2015 10:49 am

one way to only select one is to first deselect all..

sprite on touched
(sub) system pick all sprite
> sprite set selected to false
(sub)
> sprite set selected to true

where both subevents are on the same level..
the first subevent will select all and set them to false,
the second will still reference the touched sprite..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 27, 2015 12:55 pm

LittleStain wrote:one way to only select one is to first deselect all..

sprite on touched
(sub) system pick all sprite
> sprite set selected to false
(sub)
> sprite set selected to true

where both subevents are on the same level..
the first subevent will select all and set them to false,
the second will still reference the touched sprite..


Thank you very much. You are the GOD!!!
B
5
Posts: 31
Reputation: 361

Post » Wed Oct 28, 2015 5:15 am

@LittleStain quite curious about your example could it be use multiple time to use for multiple sprite but you only need to select one out of sprite in order of A B C D

and would it reset the picking order if I were to say touch the Sprite B would be true while A C D would be false and so on ?
Cause in my game i am having problem getting the sprite to be selected again after the first could i use this string to reset the picking instance ?
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Wed Oct 28, 2015 9:02 am

Gearworkdragon wrote:@LittleStain quite curious about your example could it be use multiple time to use for multiple sprite but you only need to select one out of sprite in order of A B C D

and would it reset the picking order if I were to say touch the Sprite B would be true while A C D would be false and so on ?
Cause in my game i am having problem getting the sprite to be selected again after the first could i use this string to reset the picking instance ?


I'm sorry, but I don't understand the question..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: alextro, ivanski1983 and 11 guests