Movement and direction of avatar

Get help using Construct 2

Post » Sat Mar 03, 2012 12:11 pm

I just started working with C2 and I love it. I searched the forum but couldn't find any solutions to my "problem". But I think the biggest problem is that I'm not used to C2 yet (and how to think/build things).

What I want to do is that I have 8way 45-degree movement but if I hold down and then press left I want it to keep the animation set for down but If I release down and keep holding left it should switch to the left animations and so on. Much like the old Zelda 3.

I want to later add attacks to this etc and the avatar should only swing/shoot in the direction he is "looking" so to say.

So how do I set up this in a good way so I can continue build on it?
B
2
Posts: 1
Reputation: 352

Post » Sat Mar 03, 2012 1:29 pm

Wait... You want 8-directions of movement but only 4 directions of animation? Won't that look strange?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Mar 05, 2012 3:46 pm

I tried to use some kind of multi button keypress animation but it didn't work for me.

Still trying to figure out how to do it properly, all my results made the animation to lock when pressing 2 directions at the same time e.g. left + up.
B
3
Posts: 2
Reputation: 354

Post » Mon Mar 05, 2012 4:15 pm

The technique you should apply is seperating animation control and keyboard control. Please be aware, that not all keys work together in a multi-key solution, due to hardware restrictions.

What you could do is, take a global variable, that represents the animation you want to play and have each keypress modify this variable.
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Mar 06, 2012 1:52 pm

I tried this case now with entering a global variable on a specific value which triggers an animation. But it did not work.. What I need is something that could override the basic animation pattern and button config.

All my player animation are all in 1 event group with the name PlayerAnimation

I added -> Add global variable
Named it to: AnimationModify
Initial Value: 0

And I added 1 action to Keyboard -> Left arrow is down -> System -> Add 1 to AnimationModify

Added 1 action to Keyboard -> Down arrow is down -> System -> Add 2 to AnimationModify

Added 1 action to Keyboard -> Left arrow is released -> System -> Subtract 1 from AnimationModify

Added 1 action to Keyboard -> Down arrow is released -> System -> Subtract 2 from AnimationModify

Added -> System -> AnimationModify = 3 -> PlayerImages -> Set animation to "RunningDown" (play from beginning)


Zoa2012-03-06 14:34:03
B
3
Posts: 2
Reputation: 354


Return to How do I....?

Who is online

Users browsing this forum: Renfd, supreme676 and 27 guests