Setting up a Radar

  • So, I'm trying to get an arrow to point in the direction of an enemy ship, but my radar is on a Layer with Parallax set to 0,0 for my HUD. It won't point towards an enemy if it's on a different Layer. If I move it to the layer the enemies are on, it scrolls off screen. I've tried to Pin and Anchor the arrow, but it either stutters, or doesn't stay where I put it. Is there a way around this? Is it possible to have the arrow point relative to the enemy to my ship? Any suggestions would be very helpful!

  • Try saying this:

    • Set Arrow angle to "angle(PlayerShip.X,PlayerShip.Y,EnemyShip.X,EnemyShip.Y)"

    That way it shouldn't matter where the arrow is since it isn't part of the equation. Lemme know if it works! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This worked EXACTLY as I needed it! Thanks so much! Also, where can I find a list of internals like that? I have some programming experience, and I have noticed I can use some class based functions (self.whatever), I guess that I missed some reading somewhere. Thanks again!

  • No problem! The best place to find all kinds of handy features like that is in the manual right here on the site. For stuff like that angle expression, you'll want to read this page, system expressions:

    scirra.com/manual/126/system-expressions

    Browse around to your heart's content, there's a LOT of great info in there!

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