Touch, Play Animation, Stop Animation.

Get help using Construct 2

Post » Tue Feb 18, 2014 7:48 am

Okay, so here's what I'm trying to accomplish, every time I touch the screen I want a specific sprite to play it's animation every time you touch the screen, but when you lift your finger or thumb off the screen the animation of the sprite will stop and go back to the animation beginning.
B
6
S
1
Posts: 89
Reputation: 619

Post » Tue Feb 18, 2014 8:49 am

Hello,

You should do the tutorial if you didn't already.
That being said, you want something like this, where the "dancing" animation is looping :
example
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Post » Tue Feb 18, 2014 12:01 pm

Yeah,

Already did the tutorial, this is my account for the forums.
Anyway, what you gave me, thanks btw, did not help.
I need the one frame to play every time the player taps anywhere on the screen. And then every time their thumb or finger is lifted off the screen I want the frame to go back to the original frame it started out with or a specific frame.
B
6
S
1
Posts: 89
Reputation: 619

Post » Tue Feb 18, 2014 12:11 pm

Only one frame should play ? Just add a variable on the sprite so you can store the current frame (for later) before changing it. Instead of using "Play animation from beginning", start it from a given frame. Use the same triggers, but at the end, start playing from the original frame, using the variable you set at the start.
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Post » Tue Feb 18, 2014 12:32 pm

Yes, so for example, every time a player touches their mobile screen, or tablet, the characters (sprite) eyes well widen, then and only then will the eyes of the character (sprite) will widen, and as soon as the player takes their finger off the screen the characters (sprite) eyes will return to a normal non-widened state. Okay, I'll try, thanks but what should I call the variable, and should it be, 0, 1 or 2
B
6
S
1
Posts: 89
Reputation: 619

Post » Tue Feb 18, 2014 12:35 pm

You call the variable as you like, it's your program and has no influence on anything else than you understanding your code.
Should it be 0, 1 or 2? I don't understand that question. If you are talking about the initial value of the variable, there is no need to set one, as it will be overwritten as soon as you use it.
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Post » Tue Feb 18, 2014 12:56 pm

Okay thank you
B
6
S
1
Posts: 89
Reputation: 619

Post » Wed Feb 19, 2014 7:28 am

not working for some reason, tried everything.
B
6
S
1
Posts: 89
Reputation: 619

Post » Fri Apr 04, 2014 4:41 am

Have you tried using the "on any touch start" and "on any touch end" to just set the animation frame from 0 to 1?

Check the attached capx for an example of using these.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 649

Post » Fri Apr 04, 2014 10:03 am

Try this demo it's same as dracogriff but with real sprite movements
You do not have the required permissions to view the files attached to this post.
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Next

Return to How do I....?

Who is online

Users browsing this forum: corporatedrone and 24 guests

cron