How do I create the mov 4 moving an obj around a circle?

Get help using Construct 2

Post » Sun Sep 04, 2016 11:43 pm

My main character will be an object used to protect earth, but how do I create the movement to rotate it 360 degrees completely around the other object?? Also, I don't know how to create waves of enemies...I know how to make them randomly spawn, but what if I want only 30 enemies of one type to spawn in round 1 and it round 2 a different??
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Sun Sep 04, 2016 11:58 pm

You can use a combination of a horizontal and vertical sine movement to create an orbit.
Mistakes were made.
B
52
S
26
G
109
Posts: 1,606
Reputation: 61,633

Post » Mon Sep 05, 2016 12:17 am

oosyrag wrote:You can use a combination of a horizontal and vertical sine movement to create an orbit.


Vertical and Horizontal Sine movements to the main character?
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Sep 05, 2016 12:35 am

Thought you meant just automatically.

In that case, the simplest way is a set of actions. You'll want to set your angle via your controls. Then, every tick, set your player to the planet's x and y, and then use the move forward at angle action together to place it in the right place. The distance is how high you want your orbit, and the angle would be angle(planet.x,planet.y,touch.x,touch.y) (or mouse.x and y if you're using mouse). If you're using keyboard arrows, you'll want an angle variable that gets modified by your arrow keys.
Mistakes were made.
B
52
S
26
G
109
Posts: 1,606
Reputation: 61,633

Post » Mon Sep 05, 2016 12:38 am

oosyrag wrote:Thought you meant just automatically.

In that case, the simplest way is a set of actions. You'll want to set your angle via your controls. Then, every tick, set your player to the planet's x and y, and then use the move forward at angle action together to place it in the right place. The distance is how high you want your orbit, and the angle would be angle(planet.x,planet.y,touch.x,touch.y) (or mouse.x and y if you're using mouse). If you're using keyboard arrows, you'll want an angle variable that gets modified by your arrow keys.


So basically I'm just setting the angle of the planets X and Y coordinate?
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Sep 05, 2016 4:52 am

Mistakes were made.
B
52
S
26
G
109
Posts: 1,606
Reputation: 61,633


Return to How do I....?

Who is online

Users browsing this forum: AllanR, brunopalermo, ST314, TheRealDannyyy, tunepunk and 24 guests