How do I toggle frames on a sprite with btn click

Just started using Construct 2? Post your questions here

Post » Thu May 12, 2016 4:43 pm

I am trying to do something very simple that I have done a million times in other languages, but cannot figure it out in Construct 2.

All I want to do is flip between two images when a user touches the sprite. I am currently using the mouse click even for testing.
When the user clicks on the sprite image, it will flip to a disabled looking image and the opposite when the user clicks it a second time. It would flip back to the enabled image.

I believe my issue is when the user clicks the image, it does row 7, but then continues onto row 8. This makes no sense to me. It should exit out and not go to the second click until the user clicks again.

If I disable action 8, action does what I want, but I need action 8 to flip back.
As you can see I have also tried using sub action.

Image
B
8
S
2
Posts: 14
Reputation: 506

Post » Thu May 12, 2016 4:58 pm

rkruis wrote:I am trying to do something very simple that I have done a million times in other languages...


try if....else

Image

or modulo

Image
B
66
S
24
G
7
Posts: 1,515
Reputation: 11,041

Post » Thu May 12, 2016 7:15 pm

Awesome - that worked. Thank you so much!
B
8
S
2
Posts: 14
Reputation: 506


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests