How can I make my object not be stuck when bounced

0 favourites
  • 14 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • It is assumed that when I press space the diver must go up and integrate an "else" to go down if it is not pressing and works correctly but when the diver touches the roof of the layout it is locked for 2 seconds and returns to To go down.

    The diver has the behavior of "bound to layout"

    I need help please !!!

  • What movement source are you using? Is it 8 direction, bullet, physics or just pixel movement?

    You can try setting it to when space key pressed and not when space key is down. That will set the condition to happen only once.

    Instead of else use a variable trigger that changes when you hit the roof of the layout.

  • I'm using personalized movement and 8 directions and I use this to raise and lower the diver

    Here is the image of how the movement is set https://www.dropbox.com/s/u5d7uq0crvwg6 ... 9.png?dl=0

    here u can see de bug https://www.scirra.com/arcade/action-ga ... ject-15533

  • OK space bar is a repeating key so it reads several presses ahead and that is why your diver hangs out too long on the ceiling.

    Instead of using ELSE use when Space Bar released or use a different non repeating key and that should fix the problem.

  • If I do it that way I release the space bar it does not go down the diver. Another idea bro?

  • Use on space key down to raise the player and on space key released to lower the play and use a global variable to make sure it stops reading the space key when it hits the ceiling

    On player hits ceiling set ignoring input CeilingHit =1

    On CeilingHit=1

    and Space key released: set player to go down, set ceilinghit=0

  • Do you say you create an action for the variable or do I first create the variable named celling and number 1? I did not really understand really well

  • Do you say you create an action for the variable or do I first create the variable named celling and number 1? I did not really understand really well

    Create the global variable Ceiling =0

    It will be changed to 1 when the player hits the ceiling to tell the events to stop reading the space bar and then you set the player to drop and reset ceiling = 0

  • How do I say that when I touch the ceiling I put it in 1?

  • How do I say that when I touch the ceiling I put it in 1?

    On player collision with ceiling: Set CeilingHit = 1

  • > How do I say that when I touch the ceiling I put it in 1?

    >

    On player collision with ceiling: Set CeilingHit = 1

    No have that condition only have "on player collision with another object" can u show me a imG plis!!!!!

  • >

    > > How do I say that when I touch the ceiling I put it in 1?

    > >

    >

    > On player collision with ceiling: Set CeilingHit = 1

    >

    No have that condition only have "on player collision with another object" can u show me a imG plis!!!!!

    You have to set the variable and it does not use ELSE

    I would have to see your capx to see what you have going on.

  • I send u PM

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I send u PM

    OK I looked over your capx and you are using a custom movement with Sine and it is that sine that is causing the problem.

    I sent you a PM with the CAPX fixed. I created a ceiling sprite to detect when your player is at the ceiling. When player overlaps the ceiling I change the angle of motion in your custom movement to 90 degrees which is down and change speed to 100 so player just bobbles along at the ceiling. You can change that speed to suit what you want and make that sprite invisible.

    No more stuck player. Pretty cool game!

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