How do I add a "press F to do function"

Get help using Construct 2

Post » Tue Mar 31, 2015 11:52 am

Hey there im currently working on a simplistic platformer and i have an issue where i want my player to climb a ladder.
The idea i had is that the player goes up to the ladder and presses a key (presumably F) and it will play an animation of the character climbing the ladder and then the sprite will move to the top of the ladder once the animation is complete.

The problem im having is i cant get it so this can only happen when the player is stood at the base of the ladder. ?

Hope someone understands what i mean and can help.
B
3
Posts: 2
Reputation: 179

Post » Tue Mar 31, 2015 12:43 pm

1.add to the player bullet behavior

2.set bullet speed to 0

3.add a new invisible object above the ladder

4.add condition:on f pressed

5.add sub-event to the above condition:is overlapping with the ladder object

6.there will be multiple things that will happen when the sub-event is working: set platform speed to 0

Set bullet angle to above

Set bullet speed to whatever the speed you want

7.add condition:on collision with the object above the ladder

8.add events to the above condition: set platform speed to the default speed

Set bullet angle to default

Set bullet speed to 0




Hope you find it useful and understand what I mean. :D
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Tue Mar 31, 2015 12:48 pm

I am sorry I forgot to say about the animation :!:

Add an event to step 4:play the climbing animation

And add to step 7:stop the climbing animation and play the default animation :D
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Tue Mar 31, 2015 2:25 pm

If everything is working except that you only want the character to climb the ladder when they are at the base, just add an "is on floor" condition. That should fix you right up.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 20 guests