For Each problems

Get help using Construct 2

Post » Tue Aug 06, 2013 3:48 am

Hi guys!

I want to create a game that involves multiple objects orbiting a planet.

I searched through the forum and found out how to get my meteor to orbit.

Basically it was X + radius * cos(period) , Y + radius *sin(period).

Using For Each to have multiple meteors results in them being lined up perfectly. I tried adding a random number and got their orbits to be larger, but I can't figure out how to keep them from being perfectly lined up. Well, short of making multiple objects for each meteor.

Does this make sense? Could anyone point me in the right direction?

Here is my capx: Orbit Test Capx

Thanks for any help!
B
5
S
1
G
1
Posts: 13
Reputation: 809

Post » Tue Aug 06, 2013 4:03 am

Kessler1_BHT.capx

Just replace all the constants with instance variables and set them differently.

Edit: fixed 360 wrap-around
Kessler1_BHTb.capxblackhornet2013-08-06 04:57:56
ImageImageImage
B
71
S
19
G
180
Posts: 3,482
Reputation: 103,185

Post » Tue Aug 06, 2013 2:15 pm

I love you.
B
5
S
1
G
1
Posts: 13
Reputation: 809


Return to How do I....?

Who is online

Users browsing this forum: AmpedRobot, katito13, oosyrag, RetroSpock, senna68, yme and 6 guests