How do I make my sprite stay diagonal when I stop moving?

Just started using Construct 2? Post your questions here

Post » Thu Nov 19, 2015 8:21 pm

Hi everybody!

I have a sprite (a square) set for 8 directional movement at 45 degree intervals, but when i stop moving diagonally, the sprite just reverts to one of the 4 directional positions (up, down, left, right). Is there a way to get it to stay facing diagonally?

Thanks!
B
4
Posts: 6
Reputation: 303

Post » Thu Nov 19, 2015 9:41 pm

@barrettwolfe
barrettwolfe wrote:Hi everybody!

I have a sprite (a square) set for 8 directional movement at 45 degree intervals, but when i stop moving diagonally, the sprite just reverts to one of the 4 directional positions (up, down, left, right). Is there a way to get it to stay facing diagonally?

Thanks!


There's no need to multi-post - you've already posted this exact question HERE.

Please just have a little patience. Many of the helpful users are from varying time zones.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
72
Posts: 5,031
Reputation: 51,372

Post » Thu Nov 26, 2015 10:17 am

I'm afraid it depends on your way to handle inputs for the player.
If you are just using the default controls, I don't think it can work, other than if the user uses the arrow key in diagonal and release both keys at the same time (using all the default configuration of the 8 direction behavior, the character stays in diagonal).

Otherwise, you would need to put some kind of buffer in your input handling and when the character was going in diagonal, check for some time between the moment the keys are released, so that even if the last input was a single arrow, you would still believe the intent was to go in diagonal.
New to Construct ? Where to start



Image Image

Image Image



Please attach a capx to any help request or bug report !
Moderator
B
262
S
93
G
55
Posts: 7,152
Reputation: 67,073

Post » Thu Nov 26, 2015 6:56 pm

It was the input. Thank you :)
B
4
Posts: 6
Reputation: 303


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests