How do I rotate a block around another block?

Just started using Construct 2? Post your questions here

Post » Wed Mar 30, 2016 1:08 pm

Message: aaronreed can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I tried using different image points as the connectors but it wasnt doing what i wanted. I also tried to just destroy the box and spawn a new one every time you click the button but it was also a wash. Simply rotating image also wasnt want i wanted as it rotated both boxes.

I want to be able to hit a key/button and have one of the boxes move to another side of the original box. But I need them to be able to have their own physics. So if one block hits something and stops and does not stop the block that did not hit.

here is a link to a you tube video to show what I mean.
https://youtu.be/gLRyEwqiLiQ

About 10 seconds in you can see him rotate the blocks and you can also see how they can separate upon collision.

Thanks for any help or pointers. Even if its just an idea for me to go and test/play around with.

Aaron
B
13
S
4
G
1
Posts: 31
Reputation: 1,439

Post » Sat Apr 02, 2016 5:30 pm

Image points should've worked. Did you set up 4 extra image points, set them up at ([Width * 1.5], Origin Y), ([Width * -0.5], Origin Y), (Origin X, [Height * 1.5]), and (Origin X, [Height * -0.5])? Then just set the rotating box's origin to the other's Imagepoint 1,2, 3, or 4 every tick, and turn it off if either of the boxes collide with any physics object. I'm assuming the boxes are the same size, by the way.

Since they're likely the same Sprite object, you'll probably need to use local variables to pick which one rotates around which.
B
20
S
5
Posts: 23
Reputation: 1,283

Post » Sun Apr 03, 2016 1:24 pm

Hey thanks. I actually had realized that I had made a mistake when trying out the Image pointsand about 1 day ago got the rotations working. Iam using instance variables and just adding/subtracting so I can rotate both ways.

Ill try to upload a capx to show where I have gotten to. I believe that many of my events are not best use, but Im just trying to use what I know to solve problems to try and mimic the game I am shooting for.

Aaron
B
13
S
4
G
1
Posts: 31
Reputation: 1,439

Post » Sun Apr 03, 2016 1:25 pm

Also thanks for the tip on turning off the blocks attachment on collision. Something so simple yet I hadnt yet thought of it.
B
13
S
4
G
1
Posts: 31
Reputation: 1,439


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest