How do I Update Player Direction - See latest post

Get help using Construct 2

Post » Mon Aug 25, 2014 9:00 pm

I have a character that has all the necessary animations etc for the diablo style movement and now I am attempting to make the player attack always in the direction he is facing.

Diablo style movement: viewtopic.php?t=64916&start=0#292616

Would it be done the same way using the ceil8 ?
Some help please as I am stumped!
Last edited by kepoly on Tue Aug 26, 2014 11:55 pm, edited 1 time in total.
B
9
S
1
Posts: 18
Reputation: 515

Post » Mon Aug 25, 2014 11:42 pm

Anyone ?
Not so much as me but the character
B
9
S
1
Posts: 18
Reputation: 515

Post » Tue Aug 26, 2014 3:36 pm

Anyone know a solution?
Need the player to be able to attack the same way as the movement is setup
B
9
S
1
Posts: 18
Reputation: 515

Post » Tue Aug 26, 2014 3:39 pm

Can't you simply switch animations?
ImageImageImageImage
B
157
S
65
G
41
Posts: 2,594
Reputation: 34,748

Post » Tue Aug 26, 2014 4:07 pm

It is a bit different in this case,
Player moves to direction of mouse(reticule) in an iso (8 direction) way

I tried adding a variable direction starting with right, and then if he is facing down, left, up etc change the attack animation but couldn't figure out how to tell(construct2) if the player is actually facing each direction as it is not a platformer(platform behavior not used)
B
9
S
1
Posts: 18
Reputation: 515

Post » Tue Aug 26, 2014 10:52 pm

More info;

Player within 22.5 angle 270 > set Player Direction = UP

Player within 22.5 angle 0 > set Player Direction = RIGHT

Player within 22.5 angle 90 > set Player Direction = DOWN

ETC, ETC, ETC for each direction(8)

When f pressed,
Player Direction = UP Set Animation to attack1

When f pressed,
Player Direction = RIGHT Set Animation to attack2

When f pressed,
Player Direction = DOWN Set Animation to attack3

ETC, ETC, ETC for each direction(8)

But it will only respond to the first one and always attack UP (attack1)
B
9
S
1
Posts: 18
Reputation: 515

Post » Wed Aug 27, 2014 2:58 am

Fixed this, but not the most efficient way.

If player animation = idle0 (right)
f pressed > set animation to attack0

ETC ETC
B
9
S
1
Posts: 18
Reputation: 515


Return to How do I....?

Who is online

Users browsing this forum: alextro, stevenode and 9 guests