Very basic animation

Get help using Construct 2

Post » Sat Jun 02, 2012 3:30 pm

Hello!

I might have the dumbest question right now, but I just have to know.
How to I play an animation while pressting the -> arrow. Like when I pres the arrow, the "Walk" animation plays..

I have done some searching in the forum and other places, but I can't really find it.. Kind of.. :|

Thank you so much if you help : )
And, here is the .capx file if you want: http://dl.dropbox.com/u/10323763/PieGame.capx
B
17
S
2
G
3
Posts: 28
Reputation: 2,777

Post » Sat Jun 02, 2012 4:00 pm

You have to add new animations with sprites to the object (right click - edit animations). Then you just use the right action (set animation if I remember correctly) with the on -> pressed event
B
103
S
27
G
15
Posts: 1,150
Reputation: 17,222

Post » Sat Jun 02, 2012 4:16 pm

Be sure to check the how do I FAQ section "Animations".

You have this example :
[quote]Set the animation according to a key pressed - LINK[/quote]
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Jun 02, 2012 4:18 pm

IMO There aren't any dumb questions when you're just starting out. It's all in knowing where to look!

I HIGHLY recommend velojet's Building a Platform game - A beginner's guide. It covers not only animation but other great tips for building a platformer.

Even though the tutorial teaches what you need, I made a few changes to your project which you can find here:

PieGameAnim.capx

I changed the walk animation to make it loop (done in the properties panel when the animation is open in the animation editor.)

I added several platform events for Sprite11:
is moving
X is moving   (that is, is moving inverted)
is jumping
is falling

Then for each of the events I added an action to set the animation for sprite11 to either walk or stay as appropriate. You can add more animations like a jump or a fall animation and use them instead of walk and fall for those cases.

If you want to add a run animation, then you would check the speed of sprite11. If it is less than a certain amount, set the animation to walk, if more set it to run.

Also, if your player is going to to be changing directions you need to make other changes to mirror the animation based on a key press. Those might require that you add a keyboard object so that you can test to see whether the left or right arrow key is pressed.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Sat Jun 02, 2012 4:47 pm

Thank you so much!
I have tried to do the tutorial you linked me to, but I could not find the character. Like I understood it, I have to pay $20 for it? Anyway.

So if I want to walk the other way, I just have to flip it over. Mirror it?

A last thing.. I can't open the edited version you send me. I have the free verion. r90 I think. And the error says I need r92 or giher. And I have tried to download and install the setup file from here.. Still same error :S

-Thanks again.UnknownPwny2012-06-02 16:49:57
B
17
S
2
G
3
Posts: 28
Reputation: 2,777

Post » Sat Jun 02, 2012 5:19 pm

Release 92

Also I don't think the tutorial is to be paid for.
And if it is just missing graphics, no big deal, just replace with your own.

In need, check the other tutorials like : how to make a platform game (a different tutorial than the one kittie linked, but that is valuable as well and should answer the original question too)Kyatric2012-06-02 17:20:25
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Jun 02, 2012 5:25 pm

Thanks!

But the bundle form the "How to make a Platform game" you get if you buy a lisence... But I can use my own sprites and stuff ;)

Thanks thanks!
B
17
S
2
G
3
Posts: 28
Reputation: 2,777


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests