[Solved] Platformer Edge Grab/Hanging Issue

This forum is currently in read-only mode.
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • 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.cap

  • Solved!

    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 <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How could I download the file to take a look at it? :S

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)