How do I make character stick to the walls/ceiling (platformer)? Kind of like spider-man does.

0 favourites
  • 6 posts
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • I tried to play with gravity, but it doesn't seem quite right (I'm a noob here).

    Here is a screenshot:

  • I've seen some examples for ladders that swap from the platforming behaviour to the 8 direction behaviour ( set to up/down only ) when a ladder is activated. You could do something similar, but by having an invisible climbing surface on the edge of the wall.

  • + Player_Base: Platform has wall to right

    ----+ Keyboard: → is down

    ----+ Player_Base: [X] Platform is on floor

    -----> Player_Base: Set Platform max fall speed to 0

    -----> Player_Base: Set Sliding to True

    -----> Player_Base: Set animation frame to 1

    ----+ Keyboard: On → released

    -----> Player_Base: Set Platform max fall speed to 1000

    -----> Player_Base: Set Sliding to False

    -----> Player_Base: Set animation frame to 0

    + Player_Base: Platform has wall to left

    ----+ Keyboard: ← is down

    ----+ Player_Base: [X] Platform is on floor

    -----> Player_Base: Set Platform max fall speed to 0

    -----> Player_Base: Set Sliding to True

    -----> Player_Base: Set animation frame to 1

    ----+ Keyboard: On ← released

    -----> Player_Base: Set Platform max fall speed to 1000

    -----> Player_Base: Set Sliding to False

    -----> Player_Base: Set animation frame to 0

    + Player_Base: [X] Platform has wall to right

    + Player_Base: [X] Platform has wall to left

    -> Player_Base: Set Platform max fall speed to 1000

    -> Player_Base: Set Sliding to False

    -> Player_Base: Set animation frame to 0

    + Keyboard: On ↑ pressed

    + Player_Base: Is Sliding

    -> Player_Base: Set Platform vector Y to -Self.Platform.JumpStrength × 1.25

    -> Player_Base: Set Bounce to True

    ----+ Player_Base: Direction = "Right"

    -----> Player_Base: Set Sliding to False

    -----> Player_Base: Set Platform vector X to -Self.Platform.MaxSpeed × 5

    ----+ Player_Base: Direction = "Left"

    -----> Player_Base: Set Sliding to False

    -----> Player_Base: Set Platform vector X to Self.Platform.MaxSpeed × 5

  • Thanks for the advices. Some of the stuff is probably a bit too advanced for me. Not sure what do you mean by Sliding, Bounce and player_base_direction. Cant find it yet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • They are instance variables for the player. The bounce is just like in Kiwi Story - don't worry about it. The sliding is a Boolean, also used for animations. And the Direction you could just replace with the 'Is mirrored' condition.

  • I think u can look in rotating platform example, u can set gravity to player-90 and set player angle depend on your position to the solid object.

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