Touch any part of sprite - rather than a part

Just started using Construct 2? Post your questions here

Post » Mon Jan 26, 2015 10:18 pm

Hi

When a sprite is clicked, I want it to flip. Then to flip back when clicked again.

This works (and I have attached the code) - however, it only works when I click the very bottom of the sprite.

When I take away the second event, then I am able to click on any part of the sprite and it flips. I don't understand why this is the case. Can anyone help?

Many thanks
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 181

Post » Mon Jan 26, 2015 11:59 pm

Check polygon collisions in animation editor.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Tue Jan 27, 2015 2:45 am

^Is the button in the bottom left of the animation editor. You can right click to add new points or delete points to get a more precise or easier to manage collision box. C2 tries to autogenerate them, but it does it oddly sometimes.
B
3
Posts: 2
Reputation: 179

Post » Tue Jan 27, 2015 3:19 am

Don't use these events. Do Touch then in a sub event check Is flipped then add Else to the sub-event and do the opposite action. This is a common mistake - event 1 sets it to flipped, then event 2 checks if it is flipped (which it is since you just flipped it), and un-flips it!
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Tue Jan 27, 2015 11:37 am

@Bythmark - I've already tried this without success.

@blackhornet - I've already tried this. without success

The problem is that I can only click the bottom of the sprite when event 2 is activated to flip it.
When it is deactivated, then I can click any part of the sprite to flip it.
B
3
Posts: 3
Reputation: 181

Post » Tue Jan 27, 2015 3:46 pm

You'll have to post what you've got.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Tue Jan 27, 2015 3:50 pm

Blackhornet is correct. You can't use the events the way you have them set up and expect it to work correctly because both sets of conditions will be true when you're touching the sprite.
You do not have the required permissions to view the files attached to this post.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Tue Jan 27, 2015 4:43 pm

Ah I didn't fully understand before about the System Else event. Thanks so much to @blackhornet and @burvey - Really appreciate the help!
B
3
Posts: 3
Reputation: 181

Post » Tue Jan 27, 2015 4:47 pm

No problem. Good luck with your game.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest