multiple direction walking anim?

Get help using Construct 2

Post » Sun Jun 16, 2013 8:32 pm

How do I switch animations by direction if I have an animation like this one:

https://dl.dropboxusercontent.com/u/16484289/anim1.jpg

for walking? Is there a way without having a bunch of events?

If you could switch anims by number instead of name it would be easier but there must be some built-in way to do it.https://dl.dropboxusercontent.com/u/16484289/anim1.jpg
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
55
S
15
G
5
Posts: 163
Reputation: 7,780

Post » Sun Jun 16, 2013 8:38 pm



https://www.scirra.com/tutorials/413/direction-based-sprite-animation

Looks like events are the way to do it... which is kinda what I thought. A behavior for this would be nice with starts and ends for animations. Seems like a very common thing to want to do.
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
55
S
15
G
5
Posts: 163
Reputation: 7,780

Post » Sun Jun 16, 2013 11:31 pm

Well you can do it in one event, but it means having each angle of your run cycle a separate animation. Basically you divide your hitbox's angle of rotation into 8 pieces so it spits out a number for each piece 0 through 7, and append that number to your animation name in the set animation event.
So it would be something like "if Playerbox is moving set animation to "Run" & int(((Playerbox.Angle+360+22.5) %360)/45". And then your run animations would have to be named Run0, Run1, Run2, etc.
I found this method in a thread a while ago but can't for the life of me find it again, so sorry for not giving credit where it's due.Ahr Ech2013-06-16 23:33:59
B
31
S
9
G
4
Posts: 198
Reputation: 5,054

Post » Sun Jun 16, 2013 11:47 pm

That's what I'm talkin' about! Thanks!
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
55
S
15
G
5
Posts: 163
Reputation: 7,780

Post » Mon Jun 17, 2013 12:23 am

B
55
S
28
G
18
Posts: 1,520
Reputation: 25,305

Post » Mon Jun 17, 2013 2:16 am

My son was all "Why is NESS in your game there?" He's a big Earthbound fan.
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
55
S
15
G
5
Posts: 163
Reputation: 7,780

Post » Mon Jun 17, 2013 5:20 am

Ah yeah, that's it! That thread is a gold mine.
B
31
S
9
G
4
Posts: 198
Reputation: 5,054


Return to How do I....?

Who is online

Users browsing this forum: ladjuric, mekonbekon, Romalex360 and 7 guests