How do I find a coordinate knowing distance and angle from a certain point?

0 favourites
  • 3 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • i'm making a 2d game where someone can make bridge-like structures like iceman. he shoots out a string of bullets with gravity (called Sprite9), which turn into platforms (called Sprite8) on contact with another solid. i am trying to spawn these platforms in 5 pixels from the contact, at the angle of motion of the bullet. i'm using "system>create object" for this so it wants me to plug in an x and y coordinate for the new Sprite8.

    I hope someone can help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Whatever the solid is that the bullet is colliding with, you can use the spawn action for that solid to spawn the platforms on the solid, or at an imagepoint/particular location on that solid. If it's 5px away then move an imagepoint 5px away and spawn them there.

  • Yeah, you can create the object at the point of collision and then use "Move 5px at angle". Or use these formulas:

    newX = startX+distance*cos(angle)

    newY = startY+distance*sin(angle)

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