Help with platfomer edgeclimb

For questions about using Classic.

Post » Tue Nov 15, 2011 1:37 am

Hello all, I am having difficulties enabling my 2D stick hero to perform an edge climb or hanging from the edge of a cliff. It sorta works but the sprite animation wont show at all when he is hanging from the edge. I used a reference to the .cap tutorial on the subject from this forum to help me out and I am still having troubles.

If someone can help it will be much appreciated.

Reference page
http://www.scirra.com/forum/platformer-with-edgeclimbing-hanging_topic42778.html


My .cap file
http://dl.dropbox.com/u/38448449/testedgeC.cap
B
2
G
1
Posts: 6
Reputation: 462

Post » Tue Nov 15, 2011 9:08 pm

The problem you are having is caused by trying to set the animation instead of using the system I made for the platform/attack animations, there is a conflict.

I have edited your cap to a working state and added some comments showing what I removed(the events are toggled off, you can delete them once you understand what has changed) and what I have added.

http://dl.dropbox.com/u/1487524/Scirra/EdgeClimbEdit.cap
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Fri Nov 18, 2011 4:15 am

Thank you very much, There is one problem I am having with this. When you try the edge climb from the other side (left side) of the platform the player gets swallowed in into the platform. How can that be fixed?
B
2
G
1
Posts: 6
Reputation: 462

Post » Fri Nov 18, 2011 8:15 am

Ok, two problems.

First is you are checking the angle of the maskplayer in events 2 and 3. It doesn't have angles.

Solutions - You could check the angle of the sprite 'Sprite', or you could check the maskplayer private variable 'dir', I would recomend the latter.

Second is you are subtracting the detector width in event 4 when you need to be adding it. maskplayer:set x to edge.x "+" edge.width
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sun Nov 20, 2011 8:00 am

Okay got it thank you!

One more thing, during the edgeclimb when I press the left or right keys the player changes direction. how about do you get it to lock directions? during the edgeclimb state. I've tried to play around with the functions such as "set angle towards object" or "set angle" but the direction will not lock.
B
2
G
1
Posts: 6
Reputation: 462

Post » Mon Nov 21, 2011 5:34 am

Put the key presses that control the left and right movements under a 'is not edge climbing' sort of event.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Mon Nov 21, 2011 11:50 pm

Thank you so much! It works!!
B
2
G
1
Posts: 6
Reputation: 462


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests