How can I make my object not be stuck when bounced

Get help using Construct 2

Post » Sat Feb 18, 2017 9:55 pm

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 !!! :? :? :? :? :?
B
10
S
2
Posts: 7
Reputation: 570

Post » Sat Feb 18, 2017 10:09 pm

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.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Feb 19, 2017 4:59 pm

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
B
10
S
2
Posts: 7
Reputation: 570

Post » Sun Feb 19, 2017 6:32 pm

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.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Thu Feb 23, 2017 10:22 pm

If I do it that way I release the space bar it does not go down the diver. Another idea bro? :cry: :cry: :cry:
B
10
S
2
Posts: 7
Reputation: 570

Post » Thu Feb 23, 2017 10:47 pm

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
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Thu Feb 23, 2017 10:56 pm

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
B
10
S
2
Posts: 7
Reputation: 570

Post » Thu Feb 23, 2017 11:00 pm

Biohazapp wrote: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
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Thu Feb 23, 2017 11:08 pm

How do I say that when I touch the ceiling I put it in 1?
B
10
S
2
Posts: 7
Reputation: 570

Post » Thu Feb 23, 2017 11:11 pm

Biohazapp wrote:How do I say that when I touch the ceiling I put it in 1?



On player collision with ceiling: Set CeilingHit = 1
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests