How do I control left/right movements (mouse/accel)

Get help using Construct 2

Post » Sun Mar 30, 2014 5:21 pm

Hi!

I have an object which has to have left/right movements. I cannot use 8-direction behavior because I won't use keyboard.
So I tried CustomMovement. The thing here is that I don't want to work with acceleration. The object physics inertia is killing me. I just want to set the object's constant speed.

Here's where I am:
Events sheet:
- System (On tart of layout): Object -> Set CustomMovement Overall speed to 1
- System (Every tick): Object -> Accelerate CustomMovement 100 toward (Object.X + touch.Beta, Object.Y)

Whenever acceleration goes left or right or even mouse movement (if it is before or after the object) I want the object to move left or right in constant speed.

Any ideas?

Thanks!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Sun Mar 30, 2014 7:56 pm

Hello!

Im not very good with C2 but I think what you would do is make the behavior 8-Direction then click on the sprite. Under behaviors click on Directions and change it to left and right. To stop the friction and inertia change the acceleration and deceleration to a very high number like 1000. I hope this helps!
B
4
Posts: 19
Reputation: 240

Post » Mon Apr 21, 2014 3:25 pm

If you are still interested, this is a way to do what you describe, without behaviors.

http://www.eli0s.com/Tests/XMovementFollowMouse.capx
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 55 guests