Note that there are some explanatory texts on larger screens.

plurals
  1. POGame programming difficult mathematical issue
    primarykey
    data
    text
    <p>The question I am about to ask could be somewhat challenging. I will try to make this as clear and cohesive as possible.</p> <p>I am currently making a game, in which I have a 'laser ring,' as shown here:</p> <p><img src="https://i.stack.imgur.com/F9JaL.png" alt="A laser ring"></p> <p>This laser ring, when prompted, will fire a 'grappling hook' which is simply the image shown below. This image's <code>frame.width</code> property is adjusted to make it fire (lengthen) and retract (shorten.) It starts at a width of 0, and as the frames progress, it lengthens until reaching the desired point.</p> <p><img src="https://i.stack.imgur.com/jzLWU.png" alt="enter image description here"></p> <p>This grappling hook, when fired, should line up with the ring so that they appear to be one item. Refer to the image below for clarity:</p> <p><img src="https://i.stack.imgur.com/CtZYC.png" alt="enter image description here"></p> <p>*Note that the grappling hook's width changes almost every frame, so a constant width cannot be assumed.</p> <p>Something else to note is that, for reasons that are difficult to explain, I can only access the <code>frame.center</code> property of the grappling hook and not the <code>frame.origin</code> property.</p> <p>So, my question to you all is this: How can I, accessing only the <code>frame.center.x</code> and <code>frame.center.y</code> properties of the grappling hook, place it around the laser ring in such a way that it appears to be seamlessly extending from the ring as shown in the above image - presumably calculated based on the angle and width of the grappling hook at any given frame?</p> <p>Any help is immensely appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload