Pole Swing help

For questions about using Classic.

Post » Tue Aug 21, 2012 5:10 am

Hello all,

I made a pole swinging engine using the cliffhanger code as reference. (Similar to Aladdin for the Snes) Once the player comes in contact with the pole the Player swings and then once the "Jump Key" is press he performs a jump flip everything works fine here.

What I would like to have assistance on is when the player is on the pole swinging, how do you lock the direction the player is facing while on the pole, if the player tries to press a directional key? Lastly, once the Jump key is press how do you make the player jump forward automatically in the direction the player is facing?

I hope this isn't too big of a request to kindly ask for assistance on, Any help would be appreciated. :/      

Posts: 35
Reputation: 445

Post » Fri Sep 07, 2012 9:31 pm

Hi ChromeGadget, a solution to the first problem is to move the direction changing events for when Move Right and Move Left is down underneath the event "hanging = 0", above the event "NOT state = Attack".

As for the second problem, add this action to jumping: maskplayer platform tab -> Set X component of motion to "210 * maskplayer.value('dir') * Sprite.AnimFrame"

The 210 is a trial-and-error value, but the by multiplying by direction you move in the right way, and multiplying by animation frame allows it to be a strong or weak jump depending when the player presses jump.

Here is the fix uploaded: https://dl.dropbox.com/u/4714446/Swing%20Fixed.cap

I marked the two changes with comments starting with "HERE:"Jayjay2012-09-07 21:39:07
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
Posts: 2,082
Reputation: 14,914

Post » Mon Sep 10, 2012 5:31 am

Thank you buddy!
Posts: 35
Reputation: 445

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest