Move Object if Mouse Is In Position

Get help using Construct 2

Post » Fri Dec 13, 2013 8:12 pm

Hello,

I'm new with construct. One thing that I find weird is the use of Events/Actions/Conditions in place of loops (for, while, if/else, etc).

Basically, I have an object that is outside of the layout (origin x=832, y=240). What I want to happen is this:

If the Mouse.X if within Layout 1 x-192, the object should move left until it's origin reaches (640,240).

And when the Mouse.X is less than the Layout 1 x-192, the object should start moving right until it's origin reaches (8.32,240) again.

But I'm not quite sure how. Can somebody help me?

Thanks!
Satellite
B
9
S
2
Posts: 28
Reputation: 811

Post » Fri Dec 13, 2013 9:49 pm

What you described in pseudo is essentially all you need to do.
Use the System > Compare Two Values for Mouse.X > 192 - Move object left. Mouse.X < 192 - Move object right.
If you need help moving objects, you can enable Bullet behaviour and set angle to move toward a specific point.
B
47
S
18
G
84
Posts: 2,269
Reputation: 49,792


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests