# Triangular Motion

Get help using Construct 2

### » Thu Aug 07, 2014 2:26 pm

I have been trying to create a series of orbits around moving centers where an object moves in a path relative to a moving object's position. I have a perfectly working circle and square motion from users from this site that work how I want all of the motions in my project to work.

The examples are attached.

This time I want a triangle motion that is just as smooth. I've tried path finding and I don't know how to edit JohnnySix's
sq.capx
example to make a triangle. I'm smart, but I only had a highschool physics class and haven't gone past pre cal so no I don't really understand how to create a triangular motion like these examples. I've spent at least 4 hours on the circle motion, 2-4 hours on the square motion, and definitely 3-4 hours on the triangle motion. I almost made the triangle motion, but my best try won't stay on the triangle's path when I move it. I will keep trying, but please help if you can make a triangle motion that moves like the circle and square example!!!
You do not have the required permissions to view the files attached to this post.
B
19
S
8
G
1
Posts: 56
Reputation: 2,043

### » Thu Aug 07, 2014 5:59 pm

What kind of triangle? Equilateral?

If that's the case, search no more.

triangular-motion.capx
You do not have the required permissions to view the files attached to this post.
Bruno

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

### » Thu Aug 07, 2014 8:44 pm

Nice example @brunopalermo !!!
B
127
S
54
G
24
Posts: 795
Reputation: 24,148

### » Fri Aug 08, 2014 5:33 pm

This isn't like the capx examples unfortunately. In the examples the motion is in relation to the center object, which moves and as it moves the motion path stays relative to the center.
B
19
S
8
G
1
Posts: 56
Reputation: 2,043

### » Fri Aug 08, 2014 5:42 pm

You can make the center dynamic, @JDunamis...
Bruno

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

### » Fri Aug 08, 2014 6:01 pm

How? Where's the center in the code?
B
19
S
8
G
1
Posts: 56
Reputation: 2,043

### » Sun Aug 10, 2014 3:50 am

I'm still looking for the answer to this. I couldn't use @brunopalermo 's example because his moved without being relative to a center object.

In my capx examples in the first post you can click and the center object follows as well as the path perfectly around the center following where ever you click.

Pathfinding does not work for this type of movement.
B
19
S
8
G
1
Posts: 56
Reputation: 2,043

### » Mon Aug 11, 2014 12:31 pm

In a equilateral triangle, the radius of a circle passing through all it's vertices is the distance between any vertex and the center, @JDunamis. That's the radius variable I added to the ball in my example. If I have the time I'll tweak it myself to make it dynamic.
Bruno

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

### » Mon Aug 11, 2014 12:39 pm

Not working perfect, but some "improvement" on bruno's example.
I hope it gives some clue as to how to make a "dynamic center".
You do not have the required permissions to view the files attached to this post.
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
307
S
126
G
99
Posts: 7,385
Reputation: 73,871

### » Mon Aug 11, 2014 3:47 pm

@Kyatric

I'm glad it isn't just me. I got kinda close. Thank you for this example.

@brunopalermo

I hope you have time to make it dynamic. I will work on fusing my close attempt with Kyatric's in the mean time.
I tried creating a right triangle so I could fuse two right triangles into a equilateral triangle, but that was glitchy.
I also had a point that the square would follow appear and used Move To command, but then when I moved the center it fell off the path even though it made a triangle standing still.

When this problem is solved I would love to put the circle, square, and triangle examples that behave the way we are aiming for relative to the center in a tutorial or frequently asked questions!
B
19
S
8
G
1
Posts: 56
Reputation: 2,043

Next

### Who is online

Users browsing this forum: dhunHERO, KongosL, Metathronos and 21 guests