Notion - Update docs

This commit is contained in:
jasongao97 2024-02-12 11:44:26 +00:00 committed by GitHub
parent 9a1106ab62
commit 2bc2ae2a9e

View file

@ -754,25 +754,41 @@ function draw() {
</thead>
<tbody>
<tr>
<td>1. A global function that receives both an <code>Attractor</code> and a <code>Mover</code>.</td>
<td>
<ol start="1">
<li>A global function that receives both an <code>Attractor</code> and a <code>Mover</code>.</li>
</ol>
</td>
<td>
<pre><code>attraction(attractor, mover);</code></pre>
</td>
</tr>
<tr>
<td>2. A method in the <code>Attractor</code> class that receives a <code>Mover</code>.</td>
<td>
<ol start="2">
<li>A method in the <code>Attractor</code> class that receives a <code>Mover</code>.</li>
</ol>
</td>
<td>
<pre><code>attractor.attract(mover);</code></pre>
</td>
</tr>
<tr>
<td>3. A method in the <code>Mover</code> class that receives an <code>Attractor</code>.</td>
<td>
<ol start="3">
<li>A method in the <code>Mover</code> class that receives an <code>Attractor</code>.</li>
</ol>
</td>
<td>
<pre><code>mover.attractedTo(attractor);</code></pre>
</td>
</tr>
<tr>
<td>4. A method in the <code>Attractor</code> class that receives a <code>Mover</code> and returns a <code>p5.Vector</code>, which is the attraction force. That attraction force is then passed into the <code>Mover</code> objects <code>applyForce()</code> method.</td>
<td>
<ol start="4">
<li>A method in the <code>Attractor</code> class that receives a <code>Mover</code> and returns a <code>p5.Vector</code>, which is the attraction force. That attraction force is then passed into the <code>Mover</code> objects <code>applyForce()</code> method.</li>
</ol>
</td>
<td>
<pre><code>let force = attractor.attract(mover);
mover.applyForce(force);</code></pre>