How do I slide cancel...

For questions about using Classic.

Post » Wed Jul 13, 2011 9:50 am

In my current project, I have the ability to slide in place, when you hold down and press the jump key (I'm using platform behaviour) the player has control removed and is moved, with an automated system, a set distance. At any point, however, the player needs to be able to hit the jump key again to jump straight up, cancelling the slide altogether. I've got everything working, except one thing. For whatever reason, Construct seems to like to see the first single Jump press as a trigger for both the slide and the cancel, thus holding down and pressing jump makes the player jump... But it only does this the first time, when down and jump are pressed again, the player slides properly. However, if the slide is left to finish on its own, then the next time the player goes to slide, they'll jump first and have to trigger the slide again, but if the player cancels the slide, then they will slide properly the next time on the first try. I've spent 3 days trying to work this out and have gotten no where, any help would be GREATLY appreciated lol.
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Wed Jul 13, 2011 10:44 am

Try something like this if you have not already

Player holds down - pv to 1
pv is 1 + player presses jump - slide
                             - pv to 2
pv is 2 + player presses jump - cancel slide
                             - pv to 0

#player holds down - pv to 0(this line is inverted)
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Wed Jul 13, 2011 11:01 am

been there, done that I'm afraid
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Wed Jul 13, 2011 12:05 pm

B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Wed Jul 13, 2011 8:18 pm

so you're saying I need to make the slide cancel and the slide init the same event... brilliant! I'll give it a try, thanks R0J0
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Wed Jul 13, 2011 9:52 pm

so the only problems now, are that if the player presses shift to cancel while still holding down, then the slide is started over, extending it for as long as the player wants. The only way to truly cancel the slide is to press jump by itself, and unfortunately this is wrong as this is a fan game that is emulating a pre-existing engine. Any ideas?
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Wed Jul 13, 2011 10:31 pm

A way to fix it would be to only set the slide time if the player is not already sliding.

http://dl.dropbox.com/u/5426011/examples5/slide2.cap
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Thu Jul 14, 2011 3:32 am

SOLVED!!!! Good GOD THANK YOU!!!
B
64
S
8
G
9
Posts: 290
Reputation: 8,590


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests