How do I move opposite?

0 favourites
  • 2 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hello

    I have two strikers, if I slide one striker to the right then the other striker should move opposite to other.

    For example, if my striker is 100 pixels to the right from the center of the layout, the other striker should be 100 pixels to the left.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • set a global variable for centerX

    do you want them to move like a foosball table? one goes right, the other goes with it.

    like a foosball table. 0X000c0X000 00X00c00X00 0000Xc0000X

    striker1.X-centerX= striker2.X C=500 S1=800 S2=800-500=300

    striker1.X-centerX= striker2.X C=500 S1=1000 S2=1000-500=500

    or.. like a mirror? one goes right, the other goes left? X0000c0000X

    centerX*2-striker1.x

    striker2=0 c=500 striker1=1000

    0X000c000X0

    st2=100 c=500 st1=900

    hope i mathed this out ok. i assume striker1 is right of center( as you said he has 100 pixels)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)