How do I smooth out player rotation

Get help using Construct 2

Post » Tue Jan 24, 2017 10:43 am

Hi all,

I'm making a top down maze game and just need a few pointers setting up the player character.

I'd like the player to rotate smoothly around the 360 axis with 8 directions of movement and have tried various settings.
Currently I have it set as:

8Direction
Max Speed: 100
Acceleration: 60
Deceleration: 1000
Directions: 8 directions
Set angle: 360 degree (smooth)
Default controls: Yes
Initial state: Enabled

The controls will be 4 direction arrow sprites on screen.

When you press say from up to down the character flips instantly to that direction, I'd like this to be a smooth rotation if possible?

Also I noticed that if you hold down a direction and press another direction at the same time, occasionally the player will keep moving on it's own in that direction, is this a known fault?

Thanks in advance

Alex
B
3
Posts: 7
Reputation: 201

Post » Tue Jan 24, 2017 11:15 am

The 360 rotation is designed more for the sprite to be a car like sprite. You only have one sprite and it will rotate smoothly around a single image point usually centered.

Set your player sprite to behavior car and try that.

The keyboard reads last key pressed so it sounds like you need an event to check if a key was released and use a variable to keep track.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Jan 24, 2017 5:39 pm

Thanks LaMar, that's much better!
B
3
Posts: 7
Reputation: 201

Post » Tue Jan 24, 2017 5:43 pm

ALF1EE wrote:Thanks LaMar, that's much better!



You are very welcome!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 46 guests