8 Direction animation headache

Get help using Construct 2

Post » Wed Jul 04, 2012 10:00 pm

Hello forum, I was wondering if someone could check my pseudo?

I'm working the animation system for a top down shooter, the character is currently split into 3 layers (Lower body, upper body and head) all stacked on top of each other; the following is my attempt to work out how the lower body (The feet) will work:

It's currently contains two animations; Walk Forward, which shows the feet moving back and forth, and Walk Sideways which shows the feet strafing. It's my intention to have the Walk Forward animation play when the player is moving forward or backwards, and Walk Sideways when moving sideways.

I naively thought that simple assigning the animations to key presses would work, but my sprites draw their angle from the mouse, and therefore it is possible for the player to push the "W" key (Which moves forwards from the default angle) and move sideways in relation to the mouse angle, this obviously creates problems.


Below is a quick diagram I threw together to work out the animations:


My plan is to create 8 events, WF1-4 and WS1-4: The diagram above demonstrates the conditions for each event, for example:

If the angle is between A8(315) and A1(45)and W is pressed, Walk Forward will play; if not (Else) Walk Sideways will play. The condition being the angle.

After writing all of this my head hurts... I have a good feeling I'm severely over-complicating things; please help!Mr E Bear2012-07-04 22:01:31
B
49
S
14
G
3
Posts: 540
Reputation: 5,611

Post » Wed Jul 04, 2012 11:07 pm

Whenever I make topdown animations, I never think in terms of forwards or sideways. It's always in terms of north, south, east, or west. As a heads up, an angle of 0 in Construct is always facing east, and if I remember correctly it likes to read the angles back as this:

      -90
180        0
       90TL222012-07-04 23:07:20
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Wed Jul 04, 2012 11:10 pm

so basically you try to make a movement like "Alien Shooter"?

did you tried ataching the torso to the legs and making the torso act like a turret?ericrevollo2012-07-04 23:13:50
B
4
G
1
Posts: 18
Reputation: 636

Post » Wed Jul 04, 2012 11:27 pm

Thank you for the replies :D

Similar to Alien Shooter; except when I say top-down shooter, I mean it literally, a birds eye view.

Both the lower and upper body are directly synced to the mouse angle, it makes little difference: Though in mis-reading what you what you said (I originally interpreted it as detaching the feet from the mouse angle)I've thought of a quick fix; if the feet were made more simplistically in a general circle shape (Currently they're oval) they would appear the same from every angle, and as such the animation would display the correct leg work for the angle, however it would look cheap.

What I'd really like is some CC on my proposed fix, and some help on the event construction :)Mr E Bear2012-07-04 23:28:49
B
49
S
14
G
3
Posts: 540
Reputation: 5,611

Post » Fri Jul 06, 2012 9:47 pm

A quick update on this, I decided to ditch my frankly over complicated animation system in favour for a much simpler one, diagram below:



The condition is now dependant on the compass sprite (Synced with player movement/orientation) overlapping with one of four direction sprites that surround the game area.

It effectively works, though there's some faults as I don't quite understand how the animation commands work

Anyone have any ideas on how to improve animation logic? Currently it works great if you release the direction key every now and then and try and stay off of multi-key presses, but how would I go about improving the system to account for these?

Obvious flaws that would be a quick fix is both animations playing on start-up and the length of compass not being perfect :)

Here's the .capx:
https://dl.dropbox.com/u/79581486/move.capx
B
49
S
14
G
3
Posts: 540
Reputation: 5,611

Post » Fri Jul 06, 2012 11:28 pm

How about this?
8dirFeetAnimation.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Tue Jul 10, 2012 9:18 pm

@ramones: You absolute gent! Thank you very much :D
B
49
S
14
G
3
Posts: 540
Reputation: 5,611


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests