Replacing sprites one after another with clicking

Get help using Construct 2

Post » Fri Oct 16, 2015 3:01 pm

Hello,
I need to create two different sprites one after another by clicking the left mouse button twice., or more often. The old sprite shall disappear and the new sprite shall appear at the position of the mouse when clicking. I have figured out an Event sheet for that cause (see Image).
Image
My Problem now is that it will create two red sprites and then one green sprite, then two red ones and so on. Despite the fact that on the start of the layout my Group 1 (this one should create a green sprite) is activated and Group 2 is deactivated. When i Change the Position of Group 1 and 2 it will create two green sprites then a red one. I don't know why this happens, please help me...
B
2
Posts: 3
Reputation: 156

Post » Fri Oct 16, 2015 3:52 pm

Image

This should be what your looking for!
Eat ALL THE BACON!
B
47
S
17
G
3
Posts: 290
Reputation: 5,070

Post » Fri Oct 16, 2015 4:34 pm

This works right!
I put the wait time to 0.01 seconds, feels more immediaty. I also tried my version with a wait time, it still doesn't work...
Thank you!
B
2
Posts: 3
Reputation: 156

Post » Fri Oct 16, 2015 4:46 pm

One of the numerous other ways to do this:

Image

Even easier would be to use one sprite with animationframes or animations..
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 » Fri Oct 16, 2015 4:56 pm

as per usual LS is too quick for me

https://goo.gl/23I6hM
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Fri Oct 16, 2015 5:23 pm

Thanks for all the answers.
I tried LittleStain's version and it works, too! I think it's a nice solution. Using Animation Frames wouldn't help me, i guess, since i want to use this for a mouse control like in diablo 2.
Also thanks to RamPackWobble for the answer, but i don't know how to open that public capx file, so it's not helpful until someone explains me how to open it (please do) :-D
And just for the record: I have tried it with using a globale variable, just did it wrong ^^.
B
2
Posts: 3
Reputation: 156

Post » Fri Oct 16, 2015 5:57 pm

why won't it open - is it saying it is from a latest version (I am using the latest beta) ? - https://www.scirra.com/construct2/releases/r215

edit

Image
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Fri Oct 16, 2015 6:08 pm

"feels more immediaty" You mean it doesn't happen fast enough?

Make it 0.01 then...

LS's thing should also work...
Eat ALL THE BACON!
B
47
S
17
G
3
Posts: 290
Reputation: 5,070


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 19 guests