Skip to content

Commit

Permalink
Update & publish new doc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue Fire committed Nov 26, 2023
1 parent 99e75ac commit e4a2842
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions docs/main/_sources/tutorials/platformer/step_4.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class WaterEnemy extends SpriteAnimationComponent
),
);
position = Vector2(
(gridPosition.x * size.x) + xOffset + (size.x / 2),
game.size.y - (gridPosition.y * size.y) - (size.y / 2),
(gridPosition.x * size.x) + xOffset,
game.size.y - (gridPosition.y * size.y),
);
add(RectangleHitbox(collisionType: CollisionType.passive));
add(
Expand Down Expand Up @@ -165,9 +165,7 @@ the Platform. The only difference will be instead of the `SizeEffect`, we are go
docs](../../flame/effects.md#sizeeffectby).

In short, the `MoveEffect` will last for 3 seconds, alternate directions, and run infinitely. It
will move our enemy to the left, 128 pixels (-2 x image width). You may have noticed that in the
constructor, I set `Anchor` to `center`. This was done just for the sake of making the calculations
easier but could have been left as `bottomLeft`.
will move our enemy to the left, 128 pixels (-2 x image width).

Don't forget to add the water enemy to your `lib/ember_quest.dart` file by doing:

Expand Down
1 change: 1 addition & 0 deletions docs/main/_sources/tutorials/platformer/step_7.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ void update(double dt) {
if (health <= 0) {
overlays.add('GameOver');
}
super.update(dt);
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/main/searchindex.js

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions docs/main/tutorials/platformer/step_4.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ <h2>Water Enemy<a class="headerlink" href="#water-enemy" title="Permalink to thi
<span class="w"> </span><span class="p">),</span>
<span class="w"> </span><span class="p">);</span>
<span class="w"> </span><span class="n">position</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Vector2</span><span class="p">(</span>
<span class="w"> </span><span class="p">(</span><span class="n">gridPosition</span><span class="p">.</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">size</span><span class="p">.</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">xOffset</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="p">(</span><span class="n">size</span><span class="p">.</span><span class="n">x</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">game</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="n">gridPosition</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">size</span><span class="p">.</span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="n">size</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="p">),</span>
<span class="w"> </span><span class="p">(</span><span class="n">gridPosition</span><span class="p">.</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">size</span><span class="p">.</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">xOffset</span><span class="p">,</span>
<span class="w"> </span><span class="n">game</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="n">gridPosition</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">size</span><span class="p">.</span><span class="n">y</span><span class="p">),</span>
<span class="w"> </span><span class="p">);</span>
<span class="w"> </span><span class="n">add</span><span class="p">(</span><span class="n">RectangleHitbox</span><span class="p">(</span><span class="nl">collisionType:</span><span class="w"> </span><span class="n">CollisionType</span><span class="p">.</span><span class="n">passive</span><span class="p">));</span>
<span class="w"> </span><span class="n">add</span><span class="p">(</span>
Expand Down Expand Up @@ -466,9 +466,7 @@ <h2>Water Enemy<a class="headerlink" href="#water-enemy" title="Permalink to thi
<code class="docutils literal notranslate"><span class="pre">MoveEffect</span></code>. The best resource for information will be their <a class="reference internal" href="../../flame/effects.html#sizeeffect-by"><span class="std std-ref">help
docs</span></a>.</p>
<p>In short, the <code class="docutils literal notranslate"><span class="pre">MoveEffect</span></code> will last for 3 seconds, alternate directions, and run infinitely. It
will move our enemy to the left, 128 pixels (-2 x image width). You may have noticed that in the
constructor, I set <code class="docutils literal notranslate"><span class="pre">Anchor</span></code> to <code class="docutils literal notranslate"><span class="pre">center</span></code>. This was done just for the sake of making the calculations
easier but could have been left as <code class="docutils literal notranslate"><span class="pre">bottomLeft</span></code>.</p>
will move our enemy to the left, 128 pixels (-2 x image width).</p>
<p>Don’t forget to add the water enemy to your <code class="docutils literal notranslate"><span class="pre">lib/ember_quest.dart</span></code> file by doing:</p>
<div class="highlight-dart notranslate"><div class="highlight"><pre><span></span><span class="k">case</span><span class="w"> </span><span class="nl">WaterEnemy:</span>
<span class="w"> </span><span class="n">add</span><span class="p">(</span>
Expand Down
1 change: 1 addition & 0 deletions docs/main/tutorials/platformer/step_7.html
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ <h3>Health Check for Game Over<a class="headerlink" href="#health-check-for-game
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">health</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">overlays</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;GameOver&#39;</span><span class="p">);</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">super</span><span class="p">.</span><span class="n">update</span><span class="p">(</span><span class="n">dt</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
Expand Down

0 comments on commit e4a2842

Please sign in to comment.