[SOLVED] How do I Change between idle and moving animation?

Get help using Construct 2

Post » Mon Apr 03, 2017 3:33 am

Message: junpinox can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hey guys, I'm new to game development and so far I'm liking it as a fun hobby but I've run into a confusing situation already. I have a sprite with animations for both idle and when moving and I am trying to use construct2 to make this little game. The issue is that I cannot figure out how to get the idle motion to play when the "D" or "A" keys are being pressed.

I can get the "movinganimation" to constantly loop and move back and forth when "A" or "D" is pressed but when I am not pressing either the walking animation continues to loop.

Here's my events so far:

http://imgur.com/a/xgvy4
Last edited by junpinox on Tue Apr 04, 2017 3:07 pm, edited 1 time in total.
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon Apr 03, 2017 9:38 am

Keep the animations inside the same sprite so you can handle it easily.
On <Set animation> you have to put the name of the animation you want to play. Use <Platform moving> for your issue:

On platform moving>Sprite>Set animation to "moving"

reverse that to stop

On platform moving X>Sprite>Set animation to "idle"
B
5
Posts: 15
Reputation: 255

Post » Tue Apr 04, 2017 5:16 am

Message: junpinox can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
http://imgur.com/a/PJT1b

So I figured how to set the animations into one sprite and here is what I have so far for everything. does this look about correct?
B
4
S
1
Posts: 7
Reputation: 314

Post » Tue Apr 04, 2017 8:30 am

I haven't been using C2 for that long, so not sure on best method for this. But my suggestion would be, you have an event there for the key press already, so use the action 'set animation' in there. Have it mirrored in the opposite direction for the other key press event.
B
15
S
4
Posts: 38
Reputation: 951

Post » Tue Apr 04, 2017 10:12 am

There is a little problem. When you use non default keys for platform you have to simulate the behaviour when pressed. Also, 1 pixel is way too little length, even for gameboy resolutions. One more thing: If this is a platform and your sprite is facing, let's say right, you have to mirror it when you press the opossite direction key.

Check my example:

Image


Now, if you are using the top down RPG perspective (Zelda style), use the 8 direction behaviour instead, where you will have to use different animation for all directions (non mandatory).
B
5
Posts: 15
Reputation: 255

Post » Tue Apr 04, 2017 2:24 pm

Awesome! That helps so much more visually being able to see what I'm doing wrong! I'm super new to this so visuals help me a bit.
B
4
S
1
Posts: 7
Reputation: 314

Post » Tue Apr 04, 2017 2:43 pm

I'm glad I could help you 😊
B
5
Posts: 15
Reputation: 255


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, jorgmaquoi, Rable, unicornspitfire and 11 guests