How do I do this? need help!

Get help using Construct 2

Post » Mon Sep 11, 2017 11:37 am

I have 2 objects. I want to drag one up and the other one to move down the same pixels as the first object. Please help.
B
8
Posts: 14
Reputation: 328

Post » Mon Sep 11, 2017 11:40 am

want to metion that the 2 objects are in fact only one object but with different UID
B
8
Posts: 14
Reputation: 328

Post » Mon Sep 11, 2017 12:52 pm

Here is one way to do it.
You need to add two instance variables to your object:
initY
master
Set master=1 for the first object that you want to drag up. Set master=0 for the second object that will move down.

Then add this code:
Image
Check out my awesome game Doptrix
B
17
S
9
G
51
Posts: 839
Reputation: 28,487

Post » Mon Sep 11, 2017 1:37 pm

Hey @robertg92!

It's just like @dop2000 mentioned above, but, since you want it to respond to dragging, you'd have to give the sprite the drag behavior and use an isDragging event, instead of Every tick. Here's a capx:

https://www.dropbox.com/s/34p9qj7gg4qw4 ... .capx?dl=0

Hope it helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
20
S
6
G
3
Posts: 632
Reputation: 3,766


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests