Cinematic Platformer Tap Movement Button

Get help using Construct 2

Post » Sat Aug 09, 2014 11:56 am

Hi! I'm making a cinematic platformer and I've stumbled a little problem:

Since I'm making a cinematic platformer I wanted to make it so that when you stop, your character will gradually stop moving, to do this I made 2 extra animations: 1 for when you release the move key on the right foot, and one for when you release the move key on the left foot. What the game does is that it when you release the move key, it will check the frame of the current animation (walking or running) and then play one of the to accomodating animations, depending on which foot you land on. This is fine and dandy but here is where things get a little tricky:

See, when you release the button and the game checks for the next right/left step frame, it will automatically play one of the accomodating animations, this leads to the nasty problem that you can't tap the move button to continue the normal walk/run animation without it continuously restarting one of the accomodating animations (because you also repeatidly release the button, see where I'm getting at?).

I know it might sound really confusing so here is the project file so that you can see the scripts and animations for yourself, you can find the movement script in the 'controls' event:

If someone knows a way to this problem, I'd be really greatful! Thanks!
You do not have the required permissions to view the files attached to this post.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555

Post » Sat Aug 09, 2014 12:24 pm

Cinematic platformers are very specific with their mechanics. Character always moves on grid and animations are made to give an illusion of smooth movement. Look at Flashback, Blackthorne, Another World.
Last edited by shinkan on Sat Aug 09, 2014 1:22 pm, edited 2 times in total.
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868

Post » Sat Aug 09, 2014 12:53 pm

My character doesn't move on a grid so I don't have the luxury of waiting for animations to end. :(

I also noticed another thing, in the script, the part that I've highlighted never gets to run, any idea why? Replacing the frame check with "isAnimationFinished" doesn't make a difference.
You do not have the required permissions to view the files attached to this post.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555

Post » Sat Aug 09, 2014 1:31 pm

I thought up a little work-around.

What I did was that I made it so that when you release the button, the game would wait for just under 1 sec, enough time for the accomodating animation to finish, and when it was done, you can move again. It's not super elegant but the animation don't stutter anymore when tapping, and it only becomes a hassle when you go crazy on the move button, I don't expect anyone to tap-move anyway so. Unless someone comes up with a more elegant solution, I'll keep this for now.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555


Return to How do I....?

Who is online

Users browsing this forum: Kyu and 28 guests