[Solved] Platformer Edge Grab/Hanging Issue

For questions about using Classic.

Post » Thu Aug 16, 2012 9:30 am

Hi Folks,

I've been playing around with Construct Classic to put together a platform game. So far I'm just working on the basics. However I'm having an issue with my implementation of having the player grab onto and hang from the edges of platforms.

I've looked at several of the examples/implementations that other users have posted in the forums and tried to use something similar in my setup.

Basically I'm using a small 16x16 sprite attached to the player to act as a helper to determine whether the player has collided with the edge of a platform. In turn I'm using another 16x16 sprite to designate which platform edges can be held onto by the player.

And while I can get the player sprite to grab onto a designated platform edge, the issue I have is that instead of my player 'snapping' cleanly to the edge of the platform, they are instead offset by however much of the collision helper sprite which hasn't intersected with the sprite I'm using to define a platform edge that can be grabbed.

So my question is, how do I get the collision helper to snap exactly to the edge helper sprite rather than to which ever part of the edge helper it has landed on?

I've attached a .cap of the project as it stands so you can see my code and the issue I'm mentioning. The arrow keys move the player sprite and you hold down the left Ctrl key to grab onto a ledge when jumping. Note everything is using placeholders at the moment until I get a feel for all the mechanics etc.

Collision_Test.capCthulhu2012-08-16 22:47:10
Posts: 2
Reputation: 254

Post » Thu Aug 16, 2012 10:46 pm


Firstly I was using the wrong type of condition in my events for the grabbing/hanging action. I had 'On overlap...' whereas it should have been 'On collision...'.

Secondly when I was snapping the collision helper to the edge collision sprite I was forgetting to align the player sprite to the edge collision sprites X and Y and where necessary modify this alignment by a proportion of the player sprites dimensions.

Now to tackle wall jumping Cthulhu2012-08-16 22:47:26
Posts: 2
Reputation: 254

Post » Wed Aug 29, 2012 3:28 am

How could I download the file to take a look at it? :S
Posts: 47
Reputation: 7,331

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests