Help with my conveyor belt

Get help using Construct 2

Post » Tue Nov 22, 2016 7:25 pm

I would like if it is possible that every time I touch the black object, the conveyor belt changes direction.
I have only managed to go to a single direction, but I would like to change the direction when I touch the black object
https://www.dropbox.com/s/ek5erd4nlnw1o59/cinta.capx
B
13
S
2
Posts: 297
Reputation: 1,717

Post » Tue Nov 22, 2016 7:36 pm

You need to use variables. Have a boolean variable on your Conv object and do something like "if player taps on Conv -> toggle boolean variable".

Then you can say "if the variable is true and the player is touching Conv on the bottom, he moves player.x-1", but "if the variable is false and the lpayer is touching Conv on the bottom, he moves player.x+1".
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Wed Nov 23, 2016 11:32 am

What a disaster I tried but there is no way :( Would you do it in a capx? :(
Thanks for helping me :D
B
13
S
2
Posts: 297
Reputation: 1,717

Post » Wed Nov 23, 2016 1:32 pm

@statham Here's a fixed capx with direction change on touch:

https://dl.dropboxusercontent.com/u/163 ... ta_v2.capx
B
38
S
12
G
5
Posts: 151
Reputation: 5,338

Post » Wed Nov 23, 2016 2:44 pm

Love you :lol: Thank you :D
B
13
S
2
Posts: 297
Reputation: 1,717

Post » Wed Nov 23, 2016 2:59 pm

No problem, happy to help :)
B
38
S
12
G
5
Posts: 151
Reputation: 5,338

Post » Sat Nov 26, 2016 5:23 pm

@Waltuo Someone knows because when it falls to the right it falls bad and when it falls towards the left side falls straight?
I want it to fall straight down without rotating my player
https://www.dropbox.com/s/x6nondi3yypaqwk/cov.capx?dl=0
B
13
S
2
Posts: 297
Reputation: 1,717

Post » Sun Nov 27, 2016 5:10 pm

@statham if you use physics behavior for your player, it's better to move the object by applying physics force to it instead of directly moving it (it can mess with the physics). Here's a new capx where the rotation is fixed and movement is made by applying force at angles 0 (right) and 180 (left) degrees instead.

https://dl.dropboxusercontent.com/u/163 ... ov_v2.capx

You can play with the physics elasticity and friction settings on objects if you don't want the player to bounce when hitting surfaces etc.


If you don't really need physics and want the player to drop straight down instead of flying to left/right, you could also just use a platform behavior for the player (with default controls disabled) instead:

https://dl.dropboxusercontent.com/u/163 ... tform.capx
B
38
S
12
G
5
Posts: 151
Reputation: 5,338


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests