Release of touch

Get help using Construct 2

Post » Sat Mar 16, 2013 11:48 pm

Hey guys!

Just started using construct 2 so in need of some help i'm afraid.


I've set it so far that when i hold 'down button' a bar increases its width by a scale.

However i want to set it so that when the button is released it returns back to its initial width.


Hopefully someone can help me out :).


Thanks
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Sun Mar 17, 2013 12:39 am

@Yumbie - First, welcome to Scirra and hopefully you'll get a lot of success with Construct 2 (or just C2)! Don't be discouraged that you need help so soon. It's par-for-course when you're learning - there's a LOT to absorb, after all.

What you're trying to do seems simple enough in concept, but could you provide a .capx file so we can see what you have already?
(If you don't know how to save your game as a .capx, we can help. No worries. You'll also need a file sharing/storing account with services like DropBox or SugarSync...most people here use DropBox, but I'm very fond of SugarSync - both are great sites.)Rhindon2013-03-17 00:42:01
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Sun Mar 17, 2013 1:01 am

@Rhindon Hey thanks for the fast reply. Um I can take a screen shot of the event sheet.

https://www.dropbox.com/s/ckw1i23x7g72136/random.capx

Actually uploaded my capx file. Hopefully its all sweet from here

Thanks for helping me out!
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Sun Mar 17, 2013 1:05 am

@Rhindon Hey thanks for the fast reply. Um I can take a screen shot of the event sheet.

https://www.dropbox.com/s/ckw1i23x7g72136/random.capx

Actually uploaded my capx file. Hopefully its all sweet from here

Thanks for helping me out!
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Sun Mar 17, 2013 1:28 am

The below image shows a good way to go about this:


Explanation time!

The first condition shows a standard "Is touching object" event, but inverted. This means that if the object is not being touched, then the condition will be true. To invert a condition, right click on it and press invert.

The second condition indicates that if the condition(s) above it are true, then the event will only run the first time that the conditions are true - however, if the conditions become false and then return to true, the event will run again.

Initialwidth simply implies the initial width that the object took.

Basically, it boils down to this: the first time the button isn't being touched, change the width of the object to the original.

I hope this helps you out.linkman20042013-03-17 01:29:25
Moderator
B
99
S
37
G
19
Posts: 1,584
Reputation: 17,842

Post » Sun Mar 17, 2013 2:11 am

What @linkman2004 said. :)
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Sun Mar 17, 2013 2:47 am

@Rhindon @linkman2004 Hey Thanks guys it worked!!! aw yisssssssssssss


Appreciate the help. im on the road to viridian city oo~

I now know what lies beyond the horizons of this forum.

Btw @linkman2004 Nichijou rocks! so funny
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Sun Mar 17, 2013 3:05 am

I know this has already been solved, but I'd like to suggest also a Condition in the touch object called "On Touched Object". This only performs actions when the user has just touched the screen in contact with an object.
B
24
S
5
G
1
Posts: 89
Reputation: 3,015

Post » Sun Mar 17, 2013 3:18 am

Well, actually, I didn't do much - I'm still learning MUCH about C2, too, and am not focusing on smartphone apps right now.
Though it's ALWAYS a good idea to include a .capx file. Personally, I have a folder for my games set up specifically for .capx files that I need to share for feedback and help. What I do is name the instance of that file by the game's name, a dash, then a BRIEF description of the problem I'm trying to solve. (For instance, my game's name is "Mr Stick", and I'm having trouble getting him to run one way, then have the animation change to match his change in direction when I go to the left. The .capx file name would be something like MrStick-RunDirectionAnimationChange.) This is all to help with organization.

Not sure just how deep you've already gotten with C2, but I ALSO recommend you save after virtually EVERY edit...every little change. The reason is because if C2 crashes or some other problem interrupts your progress, it's going to be fury-flaming-eyeballs when you get something to work and lose it all suddenly - it's happened to me!

Hope that all helps keep things running smoothly!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot], YoHoho and 18 guests