How do I Create a radar with orbiting circles?

0 favourites
  • 3 posts
From the Asset Store
You can change amount and speed of circles, length of lines and etc. Only 6 events.
  • I want to make it where each circle around the player (on the blue circle) represents the direction a missile is coming from and as each missile gets closer each circle must increase in size.

    I've only managed to create circles that orbit around the player when a missile is near and I got them to point in the direction of each missile. I did this using a sprite that sets its angle toward the missile.

    The problem that I've run into is I don't know how to make it so that each circle is "spawned", chooses the right missile to represent, and deletes itself after the missile is destroyed. I also am not sure how to make the circle increase or decrease in size without messing up the origin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Place dots on the circle like so:

    x = Position + Radius * cos(Angle)

    y = Position + Radius * sin(Angle)

    Position will be the center of the circle (your player ship)

    Radius is the size of the circle

    Angle will be the angle between the circle and the missile. To get that, use angle(x1,y1,x2,y2)

    When a missile is created, create a dot and give it a variable with the UID of the missile. Then use "pick by unique ID" to pair them. You can probably use a container instead if you want.

    The size of the dots can be based on the distance between the dot and the missile using distance() and...er...range conversion, maybe. Using just distance() will make them smaller as the missiles get closer.

    Hope that helps.

  • Place dots on the circle like so:

    x = Position + Radius * cos(Angle)

    y = Position + Radius * sin(Angle)

    Position will be the center of the circle (your player ship)

    Radius is the size of the circle

    Angle will be the angle between the circle and the missile. To get that, use angle(x1,y1,x2,y2)

    When a missile is created, create a dot and give it a variable with the UID of the missile. Then use "pick by unique ID" to pair them. You can probably use a container instead if you want.

    The size of the dots can be based on the distance between the dot and the missile using distance() and...er...range conversion, maybe. Using just distance() will make them smaller as the missiles get closer.

    Hope that helps.

    Thank you, this is actually a lot more practical than the way I was trying to accomplish it. I will try it.

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