<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Der Schockwellenreiter</title>
<link>https://kantel.github.io/</link>
<atom:link href="https://kantel.github.io/index.xml" rel="self" type="application/rss+xml"/>
<description>Schockwellenreiter</description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Fri, 06 Nov 2026 18:40:00 GMT</lastBuildDate>
<item>
  <title>PlotDevice – noch ein Knotenschachtel-Klon</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110601_plot_device/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55634813621/"><img src="https://kantel.github.io/posts/2026110601_plot_device/images/circlespd-b.jpg" class="img-fluid"></a></p>
<p>Nach dem <a href="https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/">vergeblichen Versuch gestern</a>, <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> zu überreden, Bilder als Vektorgraphiken abzuspeichern, rumorte es ständig in meinem Hinterkopf: Gab es da nicht noch einen Knotenschachtel-Klon? Richtig! Er heißt <strong><a href="https://plotdevice.io/">PlotDevice</a></strong>.</p>
<p><strong><a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/nodebox/plotdevice.html">PlotDevice</a></strong> (MIT-Lizenz) ist eine weitere Fork von NodeBox&nbsp;1, der interaktiven 2D-Graphik-Umgebung für macOS, die mit PyObjC alle Möglichkeiten des Macintosh-Betriebssystems voll ausnutzt. Sie ist mit dem Original-Nodebox rückwärtskompatibel, es laufen auch einige – nicht alle – alten Bibliotheken, die GUI ist aber stärker von Processing beeinflusst. Die Dokumentation zu PlotDevice ist hervorragend und vollständig.</p>
<p>Ich hatte mit PlotDevice vor elf Jahren mal ein wenig <a href="http://blog.schockwellenreiter.de/essays/plotdevicenumpy.html">herumgespielt</a> und war trotz einiger guten Ideen, die das Teil realisiert hatte, enttäuscht. Denn die Integration der NodeBox&nbsp;1-Bibliotheken war zwar versprochen, aber <a href="http://blog.schockwellenreiter.de/2015/10/2015102803.html">schlampig realisiert</a> (und »schlampig« war noch gestrunzt). Das führte dazu, daß ich in den Folgejahren nur noch die <a href="https://plotdevice.io/manual">Dokumentation</a> von PlotDevice genutzt hatte, denn die war – auch wenn vieles davon nicht in PlotDevice, sondern nur in <em>Karsten Wolfs</em> <a href="https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/">NodeBox-Fork</a> funktionierte – um Klassen besser als die Original NodeBox&nbsp;1-Dokumentation<sup>1</sup>.</p>
<p>Aber <em>tempus fuget</em>: Im Sommer 2022 wurde PlotDevice mit der <a href="https://github.com/plotdevice/plotdevice/releases/tag/v1.0.0">Version 1.1.0</a> gründlich <a href="https://github.com/plotdevice/plotdevice">überholt</a> und auch die Dokumentation, welche NodeBox&nbsp;1-Bibliotheken nun mit PlotDevice laufen und was es unter Umständen zu beachten gilt, wurde auf einer <a href="https://github.com/plotdevice/plotdevice-libs">eigenen Seite aktualisiert</a><sup>2</sup> (dort kann man die Bibliotheken (auch einzeln) herunterladen).</p>
<section id="random-circles-hochaufgelöst-in-plotdevice" class="level3">
<h3 class="anchored" data-anchor-id="random-circles-hochaufgelöst-in-plotdevice">Random Circles (hochaufgelöst) in PlotDevice</h3>
<p>Es scheint also, als ob PlotDevice spätestems seit 2022 eine nutzbare Alternative sein kann, die ich schändlicherweise übersehen habe. Aus Frust über die P5.js-Enttäuschung gestern und um PlotDevice zu testen, habe ich das Skript mal nach PlotDevice portiert (siehe <a href="https://www.flickr.com/photos/schockwellenreiter/55634813621/">Screenshot</a> im Bannerbild oben):</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> random <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> randint</span>
<span id="cb1-2"></span>
<span id="cb1-3">WIDTH, HEIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span></span>
<span id="cb1-4">malewitsch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#334775"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6484ac"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f09108"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f2cf90"</span>,</span>
<span id="cb1-5">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#ea4e4a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e8434c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#906120"</span>]</span>
<span id="cb1-6"></span>
<span id="cb1-7">size(WIDTH, HEIGHT)</span>
<span id="cb1-8">background(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#62c777"</span>)</span>
<span id="cb1-9">strokewidth(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>):</span>
<span id="cb1-11">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, WIDTH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb1-12">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, HEIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb1-13">    stroke(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>)</span>
<span id="cb1-14">    fill(malewitsch[(randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(malewitsch) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-15">    arc(x, y, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb1-16">    nostroke()</span>
<span id="cb1-17">    fill(malewitsch[(randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(malewitsch) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.4</span>)</span>
<span id="cb1-18">    radius <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb1-19">    arc(x, y, radius)</span>
<span id="cb1-20"></span>
<span id="cb1-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I did it, Babe!"</span>)</span></code></pre></div></div>
<p>Das Skript ist erstaunlich kurz, was aber auch daran liegt, dass ich auf die Unterteilung in <code>setup()</code> und <code>draw()</code> verzichten konnte. Der Sketch läuft linear durch und wenn ich mit dem Ergebnis nicht zufrieden bin, starte ich ihn einfach neu.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55633828207/"><img src="https://kantel.github.io/posts/2026110601_plot_device/images/circlespd-l.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Das Ergebnis als hochaufgelöstes PDF (Ausschnitt)</figcaption>
</figure>
</div>
<p>Wenn man das Resultat eines Durchlaufs als PDF abspeichert (entweder über das Menü <code>File -&gt; Export as Image …</code> oder über den kleinen Photoapparat rechts oben im Programmfenster), erhält man eine Datei, die sich beliebig hochskalieren lässt. Das war es eigentlich, was ich mir auch von P5.js erhofft hatte.</p>
</section>
<section id="random-circles-hochaufgelöst-in-nodebox-1" class="level3">
<h3 class="anchored" data-anchor-id="random-circles-hochaufgelöst-in-nodebox-1">Random Circles (hochaufgelöst) in NodeBox 1</h3>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55637059740/"><img src="https://kantel.github.io/posts/2026110601_plot_device/images/circlesnodebox-b.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Random Circles mit der NodeBox&nbsp;1</figcaption>
</figure>
</div>
<p>Und NodeBox&nbsp;1? Natürlich musste ich das Experiment auch mit <em>Karsten Wolfs</em> Fork der Knotenschachtel durchführen. Ich hatte gehofft, den Quellcode Eins-zu-Eins übernehmen zu können, aber ein wenig unterschieden sich die beiden Programme doch. Hier ist also meine Version der zufälligen Kreise für die Knotenschachtel:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> random <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> randint</span>
<span id="cb2-2">colormode(RGB, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">255</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4">WIDTH, HEIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span></span>
<span id="cb2-5">malewitsch0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#334775"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6484ac"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f09108"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f2cf90"</span>,</span>
<span id="cb2-6">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#ea4e4a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e8434c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#906120"</span>]</span>
<span id="cb2-7">malewitsch1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#33477566"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6484ac66"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f0910866"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f2cf9066"</span>,</span>
<span id="cb2-8">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#ea4e4a66"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e8434c66"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#90612066"</span>]</span>
<span id="cb2-9"></span>
<span id="cb2-10">size(WIDTH, HEIGHT)</span>
<span id="cb2-11">background(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#62c777"</span>)</span>
<span id="cb2-12">strokewidth(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb2-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>):</span>
<span id="cb2-14">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, WIDTH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb2-15">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, HEIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb2-16">    stroke(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>)</span>
<span id="cb2-17">    fill(color(malewitsch0[(randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(malewitsch0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))]))</span>
<span id="cb2-18">    circle(x, y, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb2-19">    nostroke()</span>
<span id="cb2-20">    fill(color(malewitsch1[(randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(malewitsch1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))]))</span>
<span id="cb2-21">    radius <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb2-22">    circle(x, y, radius)</span>
<span id="cb2-23"></span>
<span id="cb2-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I did it, Babe!"</span>)</span></code></pre></div></div>
<p>Der Hauptunterschied ist, dass ich – wie auch bei meinen Versuchen mit P5.js – zwei Listen für die Farben anlegen musste, da ich nicht herausbekommen habe, wie man den Alphawert an den Hexstring für die Farben anhängt. Alles andere sind Kleinigkeiten (der <code>colormode()</code> muss definiert, und <code>arc()</code> verhält sich in der NodeBox anders als in PlotDevice und musste daher durch <code>circle()</code> ersetzt werden).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55636849909/"><img src="https://kantel.github.io/posts/2026110601_plot_device/images/circlesnodebox-l.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Das Ergebnis hochaufgelöst in NodeBox&nbsp;1</figcaption>
</figure>
</div>
<p>Der Clou ist aber: Die Kontenschachtel besitzt in der GUI einen Slider, mit dem man das Ergebnis bis auf 1.000 Prozent vergrößern kann. Und wie man am obigen Screenshot sieht, gibt es auch hier nichts zu meckern.</p>
</section>
<section id="fazit" class="level3">
<h3 class="anchored" data-anchor-id="fazit">Fazit</h3>
<p>Die Knotenschachtel (in der Version von <em>Karsten Wolf</em>) wie auch PlotDevice scheinen ziemlich gleichwertige Macintosh-Applikationen für kreative Programmierer (und solche, die es werden wollen) zu sein. Für PlotDevice spricht die einfachere Installation (daher ist es vielleicht ein wenig besser für Anfänger geeignet), während mir NodeBox&nbsp;1 ein wenig aktueller und ausgereifter zu sein scheint. Aber da ich beide Programme ziemlich lange aus den Augen verloren hatte, werde ich mit beiden noch einiges anstellen. Und ob ich dann eines dem anderen vorziehen werde, weiß ich noch nicht. Momentan macht es mir erst einmal viel Spaß, mit beiden zu spielen. <em>Still digging!</em></p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Fußnoten</h2>

<ol>
<li id="fn1"><p>Das hat sich mittlerweile verbessert: Bevor NodeBox&nbsp;1 zugunsten von NodeBox&nbsp;3 in ein <a href="https://nodebox.net/code/Home">Archiv abgeschoben und eingefroren wurde</a>, hatte sich jemand der Dokumentation angenommen und sie auf den damaligen Stand gebracht und alle Fehler (das waren in der Hauptsache im Daten-Nirwana verschwunde Bilder) ausgemerzt.↩︎</p></li>
<li id="fn2"><p>Das gilt übrigens auch für die NodeBox&nbsp;1-Fork von <em>Karsten Wolf</em>: Auch er hat eine <a href="https://github.com/karstenw/Library">NodeBox Library</a>-Seite, in der nicht nur die »klassischen« NodeBox&nbsp;1-Bibliotheken aufgeführ sind (und ob sie mit der Fork laufen), sondern auch alle Änderungen und Neuerungen. Natürlich kann man auch hier die Bibliotheken (auch einzeln) herunterladen.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>PlotDevice</category>
  <category>NodeBox</category>
  <category>Python</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026110601_plot_device/</guid>
  <pubDate>Fri, 06 Nov 2026 18:40:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110601_plot_device/images/circlespd.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Keine hochaufgelösten PDF oder SVG in P5.js?</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55628137706/"><img src="https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/images/randomcircles-b.jpg" class="img-fluid"></a></p>
<p>Die <a href="https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/">gestern wiederentdeckte</a> und freudig begrüßte <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/nodebox/nodebox.html">Knotenschachtel</a> wird auf einmal ganz schnell relevant, da es mir entgegen meinen Erwartungen nicht gelungen ist, <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> dazu zu überreden, Bilder als Vektorgraphiken abzuspeichern, die es erlauben, sie verlustfrei hochzuskalieren, um sie damit zum Beispiel in Print-Projekten wie »<a href="http://blog.schockwellenreiter.de/2022/03/2022031101.html">Generative Art auf Papier und zwischen zwei Pappedeckel gepreßt</a>« zu nutzen.</p>
<p>Was habe ich versucht? Ich habe das Python-Skript aus <a href="http://blog.schockwellenreiter.de/2022/07/2022072201.html">meinen alten Versuchen</a> nach P5.js portiert und dann nach Libraries für den PDF-, respeketive SVG-Export gesucht. Leider erfolglos. Die einzige Methode, die ich gefunden habe, bestand aus einer Kombination aus den Modulen <a href="https://github.com/zenozeng/p5.js-pdf">p5.pdf</a> und <a href="https://github.com/zenozeng/p5.js-svg/">p5.js-svg</a>. Doch während ich <code>p5.pdf</code> noch lokal herunterladen und in meinen Sketch einbinden konnte, ließ sich <code>p5.js-svg</code> nur über</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource html number-lines code-with-copy"><code class="sourceCode html"><span id="cb1-1"><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">&lt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">script</span><span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;"> src</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://unpkg.com/p5.js-svg@1.6.0"</span><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">&gt;&lt;/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">script</span><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">&gt;</span></span></code></pre></div></div>
<p>einbinden. Und dieser Server scheint nicht mehr zu existieren (oder das Modul nicht mehr mit P5.js&nbsp;2.x zusammenzuspielen). Jedenfalls bekam ich die Fehlermeldung, dass das Modul nicht geladen werden konnte.</p>
<p>Dann gab es von <em>Golan Levin</em> noch das Modul <a href="https://github.com/golanlevin/p5.plotSvg">p5.plotSvg</a>. Das funktionierte im Prinzip hervorragend, jedoch ist es für das Zusammenspiel mit Stiftplottern konzipiert. Die erzeugten SVGs sind nur schwarzweiße Kreise ohne jede Farbinformation. Das war auch nicht wirklich das, was ich wollte.</p>
<p>Wenn irgendjemand von Euch da draußen noch eine Idee hat, wie das Problem zu lösen ist, die oder den bitte ich um Hinweise in meinen Kommentaren. (Der diesjährige <em>Google Summer of Code</em> (GSoC) soll einen neuen Anlauf in diese Richtung unternommen haben, also scheint die Lage nicht absolut hoffnungslos).</p>
<section id="der-code" class="level2">
<h2 class="anchored" data-anchor-id="der-code">Der Code</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55634989665/"><img src="https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/images/randomcircles_png.png" class="img-fluid figure-img"></a></p>
<figcaption>Original aus dem Sketch, als PNG gespeichert, nicht gerade skalierbar</figcaption>
</figure>
</div>
<p>Natürlich will ich Euch nicht den Code vorenthalten, mit dem ich all meine Versuche unternommen habe:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> WIDTH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> HEIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> NC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Number of Circles</span></span>
<span id="cb2-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> running <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-5"></span>
<span id="cb2-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setup</span>() {</span>
<span id="cb2-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(WIDTH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> HEIGHT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas = createCanvas(640, 400);   // für das Einbinden</span></span>
<span id="cb2-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas.parent("myCanvas");         // in diese Webseite </span></span>
<span id="cb2-10">}</span>
<span id="cb2-11"></span>
<span id="cb2-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">draw</span>() {</span>
<span id="cb2-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (running) {</span>
<span id="cb2-14">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomCircles</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-15">    }</span>
<span id="cb2-16">}</span>
<span id="cb2-17">    </span>
<span id="cb2-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomCircles</span>() {</span>
<span id="cb2-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">background</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#62c777"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">strokeWeight</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> NC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb2-22">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-23">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb2-24">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">stroke</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-25">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> fillcol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#334775"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6484AC"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#F09108"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-26">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#F2CF90"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#EA4E4A"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E8434C"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-27">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#906120"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>                            </span>
<span id="cb2-28">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fill</span>(fillcol)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-29">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">circle</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>)</span>
<span id="cb2-30">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> transcol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#33477564"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6484AC64"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> </span>
<span id="cb2-31">                               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#EA4E4A64"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#F0910864"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-32">                               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#F2CF9064"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E8434C64"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-33">                               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#90612064"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-34">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">noStroke</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-35">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fill</span>(transcol)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-36">        radius <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-37">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">circle</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>radius)</span>
<span id="cb2-38">    }</span>
<span id="cb2-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// draw() anhalten und Frame speichern</span></span>
<span id="cb2-40">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">save</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"randomcircles.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb2-41">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">console</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"After Save"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-42">    running <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-43">}</span>
<span id="cb2-44"></span>
<span id="cb2-45"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mousePressed</span>() {</span>
<span id="cb2-46">    running <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-47">}</span></code></pre></div></div>
<p>Die Funktion <code>draw()</code> wird nach jedem Durchlauf angehalten (<code>running = false</code>), damit das enstandene Bild mit</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">save</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"filename.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>als PNG gespeichert werden kann. Die Funktion <code>save()</code> kann neben PNGs auch JPGs abspeichern. Das Format erkennt sie an der Datei-Endung<sup>1</sup>. Das Ergebnis eines Durchlaufs seht Ihr oben. Zum Einbinden in eine Webseite mag es noch geeignet sein, aber auf gar keinen Fall für die Verwendung in einem Print-Produkt.</p>
<p>Drückt mir die Daumen, dass ich dafür doch noch eine Lösung finde. <em>Still digging!</em></p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Fußnoten</h2>

<ol>
<li id="fn1"><p>Die Funktion <a href="https://p5js.org/reference/p5/save/">save()</a> kann noch mehr. Neben Bildern kann sie auch Text, JSON, CSV oder HTML, aber leider weder PDF noch SVG.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/</guid>
  <pubDate>Thu, 05 Nov 2026 18:45:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110502_no_svg_pdf_mit_p5js/images/randomcircles.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Neuköllner Bilderbogen: Herbstbuntes Neukölln</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110501_herbstbuntes_neukoelln/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55634496270/"><img src="https://kantel.github.io/posts/2026110501_herbstbuntes_neukoelln/images/herbstbuntesneukoelln-b.jpg" class="img-fluid"></a></p>
<p>Glaubt man den Wetterfröschen – aber wer glaubt ihnen schon – war das heute der letzte, sonnige Herbsttag in diesem Jahr. Daher bin ich noch einmal raus und habe ein Photo dieses herbstbunten Baumes am Britzer Damm geschossen.</p>
<p>Nach all den Hiobsbotschaften aus der Politik (und dem Polizeibericht) soll dieses Bild zeigen, dass Neukölln auch schön sein kann. Ich lebe (<a href="https://www.zeit.de/online/2006/14/Neukoelln/komplettansicht">immer noch</a>) gerne hier.</p>
<hr>
<p><strong>Photo</strong> (<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">cc</a>) 2026: <em><a href="http://cognitiones.kantel-chaos-team.de/cv.html">Jörg Kantel</a></em></p>



 ]]></description>
  <category>Neukölln</category>
  <category>Neuköllner Bilderbogen</category>
  <category>Photographie</category>
  <guid>https://kantel.github.io/posts/2026110501_herbstbuntes_neukoelln/</guid>
  <pubDate>Thu, 05 Nov 2026 14:50:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110501_herbstbuntes_neukoelln/images/herbstbuntesneukoelln.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>NodeBox 1: First final Release</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55632366053/"><img src="https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/images/nodebox1new-b.jpg" class="img-fluid"></a></p>
<p>Da flatterte doch gestern Abend eine Nachricht in meine Mailbox, dass von der <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/nodebox/nodebox.html">Nodebox&nbsp;1</a> in der Fork von <em>Karsten Wolf</em> nach über zweijähriger Pause die <a href="https://github.com/karstenw/nodebox-pyobjc/releases/tag/v1.10.3">Version 1.10.3</a> erschienen sei. Es müssen schon sehr treue Leser dieses <del>Blogs</del> Kritzelhefts sein, die sich noch erinnern. Nodebox&nbsp;1 ist ein freies (MIT-Lizenz) macOS-Programm für die kreative Graphikprogrammierung (statische, animierte und interaktive Graphiken). Es nutzt Python als Skriptsprache und kann die Ergebnisse wahlweise als PDF (auch mehrseitige) oder als QuickTime-Movie exportieren, aber auch TIFF, PNG oder JPEG herausschreiben.</p>
<p>Nachdem die »<a href="https://nodebox.net/code/Home">offizielle NodeBox 1</a>« keine Weiterentwicklung mehr erfahren hatte, hat <em>Karsten Wolf</em> <a href="https://github.com/karstenw/nodebox-pyobjc">eine Fork angelegt</a>, und wie man sieht, pflegt er sie – wenn auch mit langen Pausen – unermüdlich weiter. Ich hatte damals auch sehr viel mit dem Teil (von mir liebevoll »Tropfenschachel« genannt) angestellt und stand in häufigem Kontakt mit Karsten. So trägt auch ein Verzeichnis in den mitgelieferten Beispiel-Applikationen den Namen <code>schockwellenreiter.de</code>.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55632431714/"><img src="https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/images/nodebox1pdf.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Ausschnitt aus dem Bannerbild oben, als PDF gespeichert und extrem hochskaliert</figcaption>
</figure>
</div>
<p>NodeBox&nbsp;1 ist eine Weiterentwicklung von <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/drawbot.html">DrawBot</a> und wie diese eine Mac-only-Anwendung (da mit PyObjC erstellt). Aber da beide Programme Vektrographiken erzeugen, die verlustfrei skalierbar sind, sind sie wie geeignet für mein Projekt »<a href="http://blog.schockwellenreiter.de/2022/03/2022031101.html">Generative Art auf Papier und zwischen zwei Pappedeckel gepreßt</a>«, mit dem ich dem glücklicherweise mittlerweile wieder abklingenden NFT-Hype den Stinkefinger zeigen wollte.</p>
<p>Das Ganze kommt natürlich zur Unzeit: Ich schlage mich gerade mit der Frage herum, wie ich <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> dazu überreden kann, seine Ergebnisse als PDF oder SVG zu erzeugen, so dass auch diese verlustfrei hochskaliert werden können. In <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/processing.html">Processing</a>(.<a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/processingpy.html">py</a>)/<a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/py5.html">Py5</a> war mir dies ja schon einmal <a href="http://blog.schockwellenreiter.de/2022/07/2022072201.html">gelungen</a>, und auch in <a href="http://cognitiones.kantel-chaos-team.de/programmierung/python/tigerjython.html">TigerJython</a> war ich da (mit Abstrichen) <a href="http://blog.schockwellenreiter.de/2022/07/2022072301.html">erfolgreich</a>.</p>
<p>Aber auf der anderen Seite: Wenn das Ergebnis sowieso für den Print-Bereich gedacht ist, ist das Werkzeug, mit dem es erzeugt wird, eigentlich Nebensache. (Ich sehe mich schon wieder sehenden Auges in die Mac-only-Falle tappen.) Aber NodeBox&nbsp;1 wie auch DrawBot sind einfach zu nette Werkzeuge, die zuviel Spaß machen, als das ich sie einfach ignorieren könnte.</p>
<p>Also habe ich mir NodeBox&nbsp;1 heruntergeladen. Ich weiß nicht, ob es an dem großen Andrang kurz nach der Veröffentlichung lag, der Download dauerte jedenfalls ziemlich lange (die Datei war aber auch fett). Die Applikation kommt mit zwei Binaries, <code>NodeBox_arm.app</code> und <code>NodeBox_intel.app</code>. Entgegen dem Namen soll die ARM-Applikationen auch mit einingen Intel-Maschinen laufen, Karsten weiß allerdings nicht, ab welcher OS-Version (er schätzt ab 10.15+, aber er hat die Maschinen nicht, um das zu testen). Ich kann ein wenig Klarheit bringen, mein (Intel-) Mac-Mini läuft mit macOS 15.7.9, und der schluckt die ARM-Version nicht.</p>
<p>Also habe ich die App mit der Intel-Version gestartet (und die üblichen Apple-Sicherheitsspielchen durchgeführt) und dann – das ist wichtig – in den Settings den Library-Folder auf den Pfad der bei der Applikation mitgelieferten gesetzt. Bei mir war das <code>/Applications/NodeBox 1.10.3/Library</code>.</p>
<p>Dann habe ich die Tropfenschachtel geschlossen und wieder neu gestartet, und aus der mitgelieferten Bibliothek das Programm <code>Library/linguistics/DOWNLOAD_DATABASES_AND_INSTALL_CONCEPTNET.py</code> angeworfen. Dieses Skript initialisiert wohl einige Datenbanken, die für den Betrieb der Bibliotheken erforderlich sind.</p>
<p>Das war dann aber alles. Jetzt habe ich wieder eine funktionierende Tropfenschachtel, die neben den oben angesprochenen Ziel, generative Kunst für die Ausgabe zwischen zwei Pappedeckel zu erzeugen, sicher auch als einfach zu bedienender Ersatz für das leider sanft entschlafene Processing.py dienen kann (für diejenigen, denen Py5 zu komplex ist). Schaun wir mal, was ich damit noch alles anstellen werde. <em>Still digging!</em></p>



 ]]></description>
  <category>NodeBox</category>
  <category>Python</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/</guid>
  <pubDate>Wed, 04 Nov 2026 17:45:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110402_nodebox_1_first_final_release/images/nodebox1new.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Noch einmal Bouncing Birds in P5.js – jetzt optimiert</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110401_bouncingbirds_optimiert/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55632087788/"><img src="https://kantel.github.io/posts/2026110401_bouncingbirds_optimiert/images/bouncingbirds2-b.jpg" class="img-fluid"></a></p>
<p>Mir ist über das Wochenende noch eingefallen, wie ich den Code für das <a href="https://kantel.github.io/posts/2026102901_bouncing_birds_p5js/">Beispiel mit den aufeinanderprallenden Vogelköpfen</a> vom letzten Donnerstag noch verbessern kann. (Ich fremdel halt noch ein wenig mit JavaScript.) Und zwar betrifft dies die <code>setup()</code>-Funktion: Statt das Bild jeden Vogels einzeln in einer Variablen <code>img</code> zu laden und dann per <code>push(img)</code> in das Array <code>birdsIm[]</code> einzufügen, kann ich ja auch jeden Vogel einzeln in lokalen Variablen laden und dann alle Vogelbilder in <strong>einer</strong> Zuweisung in das Array einfügen:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">async</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setup</span>() {</span>
<span id="cb1-2"></span>
<span id="cb1-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// load the bird images</span></span>
<span id="cb1-4">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> chick <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/chick.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> chicken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/chicken.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> duck <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/duck.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-7">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> owl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/owl.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-8">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> parrot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/parrot.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> penguin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/penguin.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-10">    birdsIm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [chick<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> chicken<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> duck<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> owl<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> parrot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> penguin]</span>
<span id="cb1-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// console.log("Alle Bilder geladen.");</span></span>
<span id="cb1-12"></span>
<span id="cb1-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas = createCanvas(640, 400);   // für das Einbinden</span></span>
<span id="cb1-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas.parent("myCanvas");         // in diese Webseite</span></span>
<span id="cb1-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">imageMode</span>(CENTER)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-18">}</span></code></pre></div></div>
<p>Dadurch habe ich immerhin sechs Zeilen Code gespart (da die globale Deklaration der Variablen <code>img</code> ebenfalls entfällt).</p>



 ]]></description>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>Creative Coding</category>
  <category>Nature of Code</category>
  <guid>https://kantel.github.io/posts/2026110401_bouncingbirds_optimiert/</guid>
  <pubDate>Wed, 04 Nov 2026 14:30:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110401_bouncingbirds_optimiert/images/bouncingbirds2.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Jetzt habe ich wieder die Haare schön</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110302_haare_schoen/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55630214289/"><img src="https://kantel.github.io/posts/2026110302_haare_schoen/images/haareschoen-b.jpg" class="img-fluid"></a></p>
<p>Dieses Mal hatte die Berliner S-Bahn eine ganz exquisite Entschuldigung, warum der Bahnbetrieb in den Berliner Südosten so unzuverlässig lief: Weil ein Erfüllungsgehilfe einer durch und durch korrupten, osteuropäischen Oligarchie auf »Staatsbesuch« in Berlin weilte, hat man, statt ihn zu verhaften, den <a href="https://www.tagesspiegel.de/berlin/selenskyj-besucht-berlin-sicherheitskonferenz-fuhrt-zu-verkehrseinschrankungen--lange-staus-auf-mehreren-strassen-16233702.html">Verkehr in der Hauptstadt lahmgelegt</a>.</p>
<p>Aber irgendwie hatte ich es dennoch, wenn auch mit gebührender Verspätung, nach <del>Schweineöde</del> Schöneweide geschafft und die Berliner Haarschneiderinnen meines Vertrauens, die <a href="https://www.facebook.com/coiffeuremarinaundteam/?locale=de_DE">Coiffeure Marina &amp; Team</a> <em>(Facebook-Link)</em>, konnten mir wieder die Haare schön machen. Schließlich waren seit dem <a href="https://kantel.github.io/posts/2026090801_haare_schoen/">letzten Mal</a> schon wieder fast acht Wochen vergangen.</p>
<p>Und in sechs bis acht Wochen geht es dann weiter mit den unendlichen Geschichten rund um korrupte Oligarchien, <a href="https://de.wikipedia.org/wiki/Bahnhof_Berlin-Sch%C3%B6neweide#Umbau">versagende Berliner Bahnhofsbauten</a> und meine Versuche, mich dennoch nach Schöneweide durchzuschlagen.</p>
<hr>
<p><strong>Photo</strong> (<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">cc</a>) 2026: <em><a href="http://cognitiones.kantel-chaos-team.de/cv.html">Jörg Kantel</a></em></p>



 ]]></description>
  <category>Modernes Leben</category>
  <category>Photographie</category>
  <guid>https://kantel.github.io/posts/2026110302_haare_schoen/</guid>
  <pubDate>Tue, 03 Nov 2026 17:55:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110302_haare_schoen/images/haareschoen.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Die Zahlen für den Goldenen Oktober 2026</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026110301_mediadaten_oktober_2026/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55629024567/"><img src="https://kantel.github.io/posts/2026110301_mediadaten_oktober_2026/images/indiansummer-b.jpg" class="img-fluid"></a></p>
<p>Am Sonnabend hat sich ein Oktober von uns verabschiedet, der die an <a href="https://kantel.github.io/posts/2026100101_die_zahlen/">ihn geknüpften Erwartungen</a> eines »Goldenen Oktobers« durchaus erfüllt hat. Mit dem neuen Monat ist es daher auch wieder Zeit für die Zahlen, die machmal hochtrabend <em>Mediadaten</em> genannt werden: Im Oktober 2026 hatte der <em>Schockwellenreiter</em> laut seinem nicht immer zuverlässigen, aber dafür (hoffentlich!) DSGVO-konformen <del>Geißenpeter</del> <a href="https://www.goatcounter.com/">Neugiertool</a> exakt <strong>4.395&nbsp;Seitenaufrufe</strong>. Auch wenn die Exaktheit dieser Ziffer eine Genauigkeit der Zahl nur vortäuscht, ist dies wieder ein schönes Ergebnis. Daher freue ich mich über jede Besucherin und jeden Besucher und bedanke mich bei allen meinen Leserinnen und Lesern.</p>
<p>😎 &nbsp; <em>Bleibt mir gewogen!</em></p>
<p>Auch wenn die Spitze unverändert geblieben ist, bietet die <em>Top Five</em> des Vormonats doch wieder einige Überraschungen:</p>
<ol type="1">
<li>Wie gesagt, immer noch unangefochten an der Spitze steht der über zwei Jahre alte Klassiker »<a href="https://kantel.github.io/posts/2024011002_ki_ohne_zensor/">Bildgeneratoren und Künstliche Intelligenz – ohne Zensoren</a>«, obwohl er schon am 2.&nbsp;Januar&nbsp;2024 erschienen und damit recht überholt ist. Denn kaum etwas anderes veränderte sich in den letzten Jahren so häufig und schnell wie die Modelle der gekünstelten Intelligenzia und ihre Anbieter (und die Zensur hat leider auch zugenommen).</li>
<li>Dann folgt als echter <em>Newcomer</em> die Schreckensmeldung »<a href="https://kantel.github.io/posts/2026101601_adblocker_sind_notwehr/">Staatstrojaner via Online-Werbung: Adblocker sind Notwehr</a>« vom 16.&nbsp;Oktober dieses Jahres, der es innerhalb von nur zwei Wochen auf Platz zwei der <em>Top Five</em> geschafft hat.</li>
<li>Auch der dritte Platz ist gerade einmal anderthalb Monate alt und daher (leider) immer noch aktuell: »<a href="https://kantel.github.io/posts/2026091502_anytwo/">Bye, bye Anytype: Ist Anytwo der Abschied von meiner digitalen Rumpelkammer?</a>« vom 15.&nbsp;September&nbsp;2026, der erklärt, das und warum Anytwo mein Abschied von Anytype sei.</li>
<li>Auf Platz vier findet Ihr einen aktuellen Rant: »<a href="https://kantel.github.io/posts/2026100103_nbb_netzgesellschaft/">Die NBB-Netzgesellschaft ist inkompetent und teuer</a>« vom 1.&nbsp;Oktober&nbsp;2026. Nur wenige Tage später musste ich feststellen, dass sie nicht nur inkompetent und teuer, sondern auch <a href="https://kantel.github.io/posts/2026100502_nbb_netzgesellschaft_ii/">ihr Name Hase</a> sei. Der Rant war also mehr als gerechtfertigt.</li>
<li>Der fünfte Beitrag »<a href="https://kantel.github.io/posts/2026052601_tolaria/">Tolaria: Schon wieder ein Kandidat für meine digitale Rumpelkammer?</a>« vom 26.&nbsp;Mai&nbsp;2026 ploppte schon seit Monaten immer wieder in meinen <em>Top Ten</em> hoch. Diese Hartnäckigkeit ist nun der Grund, dass ich nun teste, ob die <a href="https://tolaria.md/">Toleria</a> die Nachfolge von Anytype antreten kann.</li>
</ol>
<p>Soviel zu testen, so wenig Zeit. <em>Still digging!</em></p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55629024567/">Der Dachs im Goldenen Oktober</a></em>, erstellt mit <a href="http://cognitiones.kantel-chaos-team.de/technikgeschichte/rechnerundnetze/scenario.html">Scenario</a>. Prompt: »<em>A badger, wearing a red dressing gown, a scarf around its neck, and rimless sunglasses on its nose, sits on a bench in an autumnal park. It has a laptop on its lap and is typing on the keyboard. All around, the autumn foliage on the trees glows in every shade of brown, red, gold, and yellow. The autumn sun illuminates the scene. Early American color comic book style, in the vein of Winsor McCay’s “Little Nemo.” No text boxes, no speech bubbles, and no headings.</em>« Modell: Nano Banana&nbsp;2.1.</p>



 ]]></description>
  <category>Interna</category>
  <category>Mediadaten</category>
  <guid>https://kantel.github.io/posts/2026110301_mediadaten_oktober_2026/</guid>
  <pubDate>Tue, 03 Nov 2026 16:20:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026110301_mediadaten_oktober_2026/images/indiansummer.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Bouncing Birds in P5.js – ohne Überschneidungen</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102901_bouncing_birds_p5js/</link>
  <description><![CDATA[ 
<script src="./sketch.js"></script>
<script src="./bird.js"></script>




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55617280522/"><img src="https://kantel.github.io/posts/2026102901_bouncing_birds_p5js/images/bouncingbirds-b.jpg" class="img-fluid"></a></p>
<p>Das vor <a href="https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/">zwei Tagen vorgestellte Skript</a> »Bouncing Balls« war für (m)einen Einstieg in <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> zwar amüsant, aber ihm fehlte doch ein wichtiges Element: Die Bälle prallten zwar von den Rändern ab, nahmen aber gegenseitig keine Notiz voneinander – sie überlappten sich nach Belieben. Also musste eine Kollisionserkennung her.</p>
<p>Die Kollisionserkennung zweier Kreise ist im Prinzip recht einfach: Wenn der Abstand zweier Kreise (gemessen vom Mittelpunkt) größer ist als die Summe der beiden Radii, dann kollidieren beide Kreise <strong>nicht</strong>. Ist er jedoch kleiner, dann überschneiden sich beide Kreise und eine Kollision liegt vor. Im Pseudecode (Python) sieht das so aus:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> is_circle_collision(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, other):</span>
<span id="cb1-2">    distance <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> math.dist([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.loc.x, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.loc.y], [other.loc.x, other.loc.y])</span>
<span id="cb1-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> distance <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> other.r:</span>
<span id="cb1-4">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb1-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span></code></pre></div></div>
<p>In meinem Skript werden die Kreise durch Bilder kreisrunder Vogelköpfe ersetzt (mehr dazu unten).</p>
<p>So nackt hat die Methode jedoch einen Nachteil: In etlichen Fällen kann es vorkommen, das sich die Kreise »verheddern« und nur schwer wieder zu trennen sind. Das liegt daran, dass – bedingt durch die Euler-Integration und die Framerate von 60 FPS – bei einer Kollision sich die Kreise so weit überschneiden, dass sie auch beim nächsten (oder über- (über-)) nächsten Schritt immer noch kollidieren.</p>
<p>Die Lösung ist aus der Spieleprogrammierung eigentlich bekannt: Bei einer Kollision setzt man die Akteure (die Kreise oder auch die Sprites/Vögel) soweit auf die Position zurück, dass sie sich zwar gerade noch berühren, aber nicht mehr überlappen. <em>Daniel Shiffman</em> hat das in seiner 184.&nbsp;Coding Challenge »<a href="https://www.youtube.com/watch?v=dJNFPv9Mj-Y">Collisions Without a Physics Library!</a>« wunderbar erklärt. In P5.js kann eine Lösung dann so aussehen:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collisionDetection</span>(other) {</span>
<span id="cb2-2">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> impactVector <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Vector</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sub</span>(other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-3">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> impactVector<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mag</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb2-5">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Push the birds out so that they are not overlapping  </span></span>
<span id="cb2-6">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> overlap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-7">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dist <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> impactVector<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">copy</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb2-8">            dist<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setMag</span>(overlap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-9">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add</span>(dist)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-10">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sub</span>(dist)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-11">        }</span>
<span id="cb2-12">}</span></code></pre></div></div>
<p>Zuerst wird die Länge der Überlappung festgestellt und dann von dem einen Vogel die Hälfte dieser Überlappung aufaddiert und bei dem anderen Vogel die Hälfte der Überlappung abgezogen. Und schon prallen die beiden Vögel zwar aufeinander, aber sie überschneiden sich nicht mehr.</p>
<p>Als Kollisionsergebnis habe ich eine Reaktion gewählt, die von diesem Video »<a href="https://www.youtube.com/watch?v=Pl_w9qSgMGY">Python Bouncing Ball Simulator 5</a>« von <em>Christian Thompson</em> (aka <em>TokyoEdtech</em> – langjährige Leser des <em>Schockwellenreiters</em> wissen Bescheid, das ist der Mann, der Unglaubliches aus Pythons Turtle herauskitzelte) inspiriert wurde: Bei einer Kollision wird einfach die Velocity der beiden beteiligten Kreise getauscht. Das ist zwar nicht wirklich eine exakte (ideale) elastische Kollision, kommt Ihr aber relativ nahe<sup>1</sup> (die folgenden Zeilen im Code <em>direkt hinter</em> der Zeile <code>other.pos.sub(dist);</code> einfügen):</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb3-1">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Swap the velocity of the colliding birds</span></span>
<span id="cb3-2">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> tempX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-3">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> tempY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-4">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-5">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-6">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tempX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-7">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tempY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>Die Hauptarbeit des Sketches wird in der Klasse <code>Bird</code> erledigt, die trotz aller Verbesserungen immer noch große Ähnlichkeit mit der Klasse <code>Ball</code> der Vorgängerversion besitzt:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb4-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Bird {</span>
<span id="cb4-2"></span>
<span id="cb4-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">constructor</span>() {</span>
<span id="cb4-4">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-5">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-6">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-7">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-8">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createVector</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-9">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-10">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-11">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createVector</span>(dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> dy)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-12">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">img</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(birdsIm)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-13">    }</span>
<span id="cb4-14"></span>
<span id="cb4-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>() {</span>
<span id="cb4-16">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-17">    }</span>
<span id="cb4-18"></span>
<span id="cb4-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">checkBoundaries</span>() {</span>
<span id="cb4-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb4-21">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-22">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-23">        } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb4-24">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-25">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-26">        }</span>
<span id="cb4-27">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb4-28">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-29">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-30">        } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb4-31">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-32">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-33">        }</span>
<span id="cb4-34">    }</span>
<span id="cb4-35"></span>
<span id="cb4-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collisionDetection</span>(other) {</span>
<span id="cb4-37">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> impactVector <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Vector</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sub</span>(other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-38">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> impactVector<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mag</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-39">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb4-40">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Push the birds out so that they are not overlapping  </span></span>
<span id="cb4-41">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> overlap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-42">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dist <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> impactVector<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">copy</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb4-43">            dist<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setMag</span>(overlap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-44">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add</span>(dist)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-45">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sub</span>(dist)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-46">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Swap the velocity of the colliding birds</span></span>
<span id="cb4-47">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> tempX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-48">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> tempY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-49">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-50">            other<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-51">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tempX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-52">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tempY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-53">         }</span>
<span id="cb4-54">    }</span>
<span id="cb4-55"></span>
<span id="cb4-56">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">display</span>() {</span>
<span id="cb4-57">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">image</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">img</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-58">    }</span>
<span id="cb4-59">}</span></code></pre></div></div>
<p>Auch bei der Methode <code>checkBoundaries()</code> bin ich dieses Mal genauer, als bei der Vorgängerversion: Wenn der Wert kleiner oder gleich der Position des Bodens oder der Seitenwände ist, wird er exakt auf die Position des Bodens oder der Seitenwände gesetzt<sup>2</sup>.</p>
<p>Das (wieder recht kurze) Hauptprogramm sieht dann so aus:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> numBirds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> birds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> birdsIm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-4"></span>
<span id="cb5-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> img<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">async</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setup</span>() {</span>
<span id="cb5-8"></span>
<span id="cb5-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// load the bird images</span></span>
<span id="cb5-10">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/chick.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-11">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-12">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/chicken.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-13">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-14">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/duck.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-15">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-16">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/owl.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-17">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-18">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/parrot.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-19">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-20">    img <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">loadImage</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"assets/penguin.png"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-21">    birdsIm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(img)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// console.log("Alle Bilder geladen.");</span></span>
<span id="cb5-23"></span>
<span id="cb5-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas = createCanvas(640, 400);   // für das Einbinden</span></span>
<span id="cb5-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas.parent("myCanvas");         // in diese Webseite</span></span>
<span id="cb5-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">imageMode</span>(CENTER)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-29">}</span>
<span id="cb5-30"></span>
<span id="cb5-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">draw</span>() {</span>
<span id="cb5-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">background</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">234</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">218</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">184</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBirds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb5-34">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBirds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb5-35">            birds[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collisionDetection</span>(birds[j])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb5-36">        }</span>
<span id="cb5-37">        birds[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">checkBoundaries</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-38">        birds[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-39">        birds[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">display</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-40">    }</span>
<span id="cb5-41">}</span>
<span id="cb5-42"></span>
<span id="cb5-43"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>() {</span>
<span id="cb5-44">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> bird <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> bird <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBirds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> bird<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb5-45">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Bird</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-46">    birds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-47">  }</span>
<span id="cb5-48">}</span>
<span id="cb5-49"></span>
<span id="cb5-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mousePressed</span>() {</span>
<span id="cb5-51">  birds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Array leeren</span></span>
<span id="cb5-52">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-53">}</span></code></pre></div></div>
<p>Es hat zwei Besonderheiten: Erstens habe ich zum Laden der Bilder das Kommandopaar <code>async</code> … <code>await</code> genutzt, das in P5.js die separate Funktion <code>preload()</code> überflüssig macht. Die Bilder werden im Array <code>birdsIm</code> gespeichert und dann im <code>constructor()</code> der Klasse <code>Bird</code> in der Zeile</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb6-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">img</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(birdsIm)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>zufällig einem Vogel zugeordnet.</p>
<p>Auch musste ich auf das schöne Schleifenkonstrukt <code>for (let bird of birds) {}</code> in der Funktion <code>draw()</code> verzichten, da ich für die Kollisionserkennung das Array <code>birds[]</code> zweimal durchlaufen musste<sup>3</sup>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb7-1">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBirds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb7-2">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBirds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb7-3">            birds[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collisionDetection</span>(birds[j])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> </span>
<span id="cb7-4">        }</span></code></pre></div></div>
<p>Die zweite Schleife durchläuft das Array nur von <code>i + 1</code> bis <code>numBirds</code>, da alle anderen Kollisionsmöglichkeiten ja vorher schon abgefragt wurden.</p>
<p>Und hier wieder der Sketch in seiner ganzen Schönheit (mit einem Mausklick in den Canvas könnt Ihr ihn neu starten):</p>
<div id="myCanvas">

</div>
<p>Die Bilder der kreisrunden Vogelköpfe stammen aus dem freien (<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>) <a href="https://kenney.nl/assets/animal-pack-remastered">Animal Pack Remastert</a> des schier unerschöpflichen Fundus von <em>Kenney</em>.</p>
<p>Wie Ihr aus dem <a href="https://www.flickr.com/photos/schockwellenreiter/55617280522/">Bannerbild</a> oben erkennen könnt, habe ich auch diesen Sketch wieder mit <a href="https://vscodium.com/">VSCodium</a>, der freien (MIT-Lizenz) Alternative zu Visual Studio Code mit den Erweiterungen <a href="https://marketplace.visualstudio.com/items?itemName=Irti.p5js-project-generator">p5.js 2.x Project Generator</a> und <a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">VS Code Live Server</a> entwickelt. Und ich bin sehr zufrieden damit. Man bekommt aussagekräftige Fehlermeldungen im <code>Problems</code>-Tab wie auch zur Laufzeit in der JavaScript-Konsole des Browsers<sup>4</sup> angezeigt. Es ist also wirklich ein guter Ersatz für den P5&nbsp;Webeditor und das Teil gibt Euch ein wenig von Eurer digitalen Souveränität zurück.</p>
<p>Wer nachlesen oder selber ein wenig damit spielen will: Ich habe diesen Sketch mit allen Assets auch auf <a href="https://github.com/kantel/p5js/tree/master/bouncingbirds">GitHub</a> und meiner <a href="https://kantel.neocities.org/p5projects/Bouncing%20Birds/">Neocities-Spielwiese</a> hochgeladen. Dort findet Ihr nicht nur das fertige Ergebnis, sondern auch den Quellcode.</p>
<p><b style="color:red;"><a href="https://kantel.github.io/posts/2026110401_bouncingbirds_optimiert/">Hier</a> gibt es eine Code-Optimierung</b>.</p>




<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Fußnoten</h2>

<ol>
<li id="fn1"><p>Wer eine genauere Simulation einer elastischen Kollision (eines (in diesem Falle zweidimensionalen) elastischen Stoß) implementieren will, kann sich ja an <a href="https://editor.p5js.org/codingtrain/sketches/3DrBb8LCp">Shiffmans Implementierung</a> orientieren. Oder sie oder er greifen gleich zu einer Physik Engine wie <a href="https://brm.io/matter-js/">Matter.js</a>.↩︎</p></li>
<li id="fn2"><p>Dadurch werden auch hier mögliche Glitches beseitigt, die von der Euler-Integration und der Framerate von (maximal) 60 FPS hervorgerufen werden könnten.↩︎</p></li>
<li id="fn3"><p>Natrlich hätte ich auch in einer zweiten Schleife mit <code>for (let bird of birds) {}</code> die Methoden <code>checkBoundaries()</code>, <code>update()</code> und <code>display()</code> separat aufrufen können, aber so schien mir das logischer.↩︎</p></li>
<li id="fn4"><p>Hier sollte man aber besser mit <code>console.log()</code> und nicht mit <code>print()</code> hantieren. Denn dann bekommt man auch die korrekte Datei und die richtige Zeilennummer angezeigt, während <code>print()</code> zwar funktioniert, aber alles in <code>p5.min.js: line 1</code> verortet.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>Creative Coding</category>
  <category>Nature of Code</category>
  <category>VSCodium</category>
  <guid>https://kantel.github.io/posts/2026102901_bouncing_birds_p5js/</guid>
  <pubDate>Thu, 29 Oct 2026 14:35:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102901_bouncing_birds_p5js/images/bouncingbirds.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Q5.js v4.10 ist frei – und kann Python</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102801_q5js_in_python/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55092418938/"><img src="https://kantel.github.io/posts/2026102801_q5js_in_python/images/diddydachs-b.jpg" class="img-fluid"></a></p>
<p>Es gibt wieder Neues von <a href="https://q5js.org/home/">Q5.js</a>, der »rasend schnellen Alternative« zu <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a>, zu berichten. Denn gestern gab <em>Quinton Ashley</em>, der Schöpfer von Q5.js, <a href="https://substack.com/inbox/post/222213957">bekannt</a>, dass die interaktive Dokumentation auf q5js.org jetzt in den Editionen <a href="https://q5js.org/learn/#coreSection">Modern JavaScript</a> und <a href="https://q5js.org/learn/?python#coreSection">Python</a> verfügbar sei.</p>
<p>Aber – und das ist für mich viel wichtiger – er erwähnte auch quasi nebenbei, dass die gestern veröffentlichte Version Q5.js&nbsp;v4.10 Open Source sei. Ich konnte es kaum glauben und habe auf <a href="https://github.com/q5js/q5.js">GitHub nachgeschaut</a>. Und tatsächlich, Q5.js steht nun unter der LPGL&nbsp;3.0-Lizenz. Damit sind meine bisher <a href="https://kantel.github.io/posts/2026101501_q5_webeditor_v2/">bestehenden Bedenken</a> bezüglich der proprietären Lizenz ausgeräumt<sup>1</sup>.</p>
<p>Daher muß ich meine Einstellung zu Q5.js ganz neu überdenken: Einmal reizt mich die Schnelligkeit, die auch die Erstellung zeit- und rechenintensiver Anwendungen – wie zum Beispiel die Programmierung der Mandelbrotmenge – vereinfacht, zum anderen die Python/<a href="http://cognitiones.kantel-chaos-team.de/programmierung/python/brython.html">Brython</a>-Unterstützung. Damit könnte Q5.js durchaus eine ernstzunehmende Alternative zum leider sanft entschlafenen <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/processingpy.html">Processing.py</a> sein.</p>
<p>Und wer – wie ich – aus Gründen der digitalen Souveränität lieber auf den <a href="https://codevre.com/q5-editor">Q5 Webeditor</a> verzichten möchte, der findet hier eine Anleitung, wie man <a href="https://github.com/q5js/q5.js/wiki/Get-Started#html">Q5.js lokal nutzen</a> kann. Ich habe also wieder zu tun. <em>Still digging!</em></p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55092418938/">Diddy Dachs und die Mandelbrotmenge</a></em>, erstellt mit <a href="https://openart.ai/home">OpenArt</a>. Prompt: »<em><span class="citation" data-cites="Diddy">@Diddy</span> Dachs sits at his desk in his cave, typing away at a computer with a large monitor. The Mandelbrot set is displayed on the screen. On the desk, a mug of steaming coffee sits next to an open notepad, on which rests an old-fashioned fountain pen. Beside it lies a red book entitled “The Nature of Code.” A floor lamp illuminates the desk. Shelves lined the cave walls, crammed with books and knick-knacks. A sliver of daylight filters in through a glass opening in the cave wall. Colored classic American comic style. No speech bubbles, no text boxes.</em>« Modell: Charakter 2.0 with Nano Banana Pro.</p>




<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Fußnoten</h2>

<ol>
<li id="fn1"><p>Das gilt leider nicht für <a href="https://q5play.org/home/">Q5.play</a>. Hier gilt immer noch die <a href="https://github.com/q5play/q5play?tab=License-1-ov-file#readme">seltsame Lizenz</a>, die für die Nutzung in der Ausbildung Knete verlangt.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Q5.js</category>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>Python</category>
  <category>Brython</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026102801_q5js_in_python/</guid>
  <pubDate>Wed, 28 Oct 2026 16:00:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102801_q5js_in_python/images/diddydachs.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Atlas Curiosa: Heiligensee im Herbst</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102702_herbst_in_heiligensee/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55605729871/"><img src="https://kantel.github.io/posts/2026102702_herbst_in_heiligensee/images/dorfangerheiligensee-b.jpg" class="img-fluid"></a></p>
<p>Über den <a href="https://kantel.github.io/posts/2026010701_alt-heiligensee/">Dorfanger in Berlin-Heiligensee</a> hatte ich ja Anfang dieses Jahres schon einmal einen Beitrag. Nun neigt sich das Jahr mit einem (hoffentlich!) goldenen Oktober dem Ende zu, und die liebste aller Freundinnen hat in der letzten Woche ein Photo des herbstlich-bunten Dorfangers geschossen, das ich Euch nicht vorenthalten möchte.</p>
<p>Heiligensee besitzt nicht nur den längsten Dorfanger Berlins, sondern um den namensgebenden See ranken sich auch <a href="https://kantel.github.io/posts/2026061001_heiligensee/">viele Sagen</a>. Und das <a href="https://www.berlin.de/tourismus/seen/4843649-4299185-heiligensee.html">Restaurant im Seebad Heiligensee</a>, Sandhauser Straße&nbsp;132, 13503&nbsp;Berlin, ist mit seiner rustikalen, gutbürgerlichen Küche und <a href="https://kantel.github.io/posts/2026092903_fuchs_in_heilgensee/">seinen Füchsen</a> auch im Herbst und Winter immer einen Besuch wert. Wir wissen das, denn wir waren am letzten Wochenende wieder einmal dort.</p>
<hr>
<p><strong>Photo</strong> © 2026: <em>Die liebste aller Freundinnen</em></p>



 ]]></description>
  <category>Atlas Curiosa</category>
  <category>Reinickendorf</category>
  <category>Photographie</category>
  <guid>https://kantel.github.io/posts/2026102702_herbst_in_heiligensee/</guid>
  <pubDate>Tue, 27 Oct 2026 19:20:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102702_herbst_in_heiligensee/images/dorfangerheiligensee.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Der P5.js Webeditor mit neuem Backend (Open Processing)</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/</link>
  <description><![CDATA[ 
<script src="./sketch.js"></script>
<script src="./ball.js"></script>




<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55615374503/"><img src="https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/images/openprocessing-b.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Bouncing Balls in OpenProcessing</figcaption>
</figure>
</div>
<p>Vom hier auf diesen Seiten regelmäßig erwähnten »Freund aus Bremen« bekam ich den Hinweis, dass der <a href="https://editor.p5js.org/">P5.js Webeditor</a> auf ein <a href="https://discourse.processing.org/t/the-p5-js-editor-is-moving-to-a-new-backend-help-us-test-it/49748">neues Backend wechselt</a>. Anstatt eigene Server zu verwenden, nutze der Editor künftig die API und Server von <a href="https://openprocessing.org/">OpenProcessing</a>. Momentan laufe ein öffentlicher Test, indem Nutzer mit einem OpenProcessing-Account aufgerufen werden, unter <a href="https://editor-op.p5js.org/">editor-op.p5.js.org</a> das neue Backend zu testen.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55614209747/"><img src="https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/images/webeditor_neu.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Bouncing Balls im »neuen« Webeditor</figcaption>
</figure>
</div>
<p>Da ich zum einen ein chronisches Spielkalb bin und zum anderen noch einen mehr oder weniger brachliegenden OpenProcessing-Account besaß, ließ ich mir dies nicht zweimal sagen, und habe dieses <a href="https://kantel.github.io/posts/2024033102_bouncing_balls_microstudio/">Bouncing-Balls-Programm</a>, das ich vor über zwei Jahren einmal in <a href="http://cognitiones.kantel-chaos-team.de/multimedia/spieleprogrammierung/microstudio.html">microStudio</a> mit Python (genauer mit <a href="https://brython.info/">Brython</a>) implementiert hatte, nach <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> portiert. Dabei musste ich feststellen, dass <code>editor-op.p5.js.org</code> mit meinem Chromebook noch ein wenig fremdelt (keine Syntax-Hervorhebung und manchmal Probleme beim Speichern), während zwei Tage später, als ich wieder an meinem Schreibtisch vor meinem betagten Mac Mini saß, die Programmierung wie geschmiert lief (siehe <a href="https://www.flickr.com/photos/schockwellenreiter/55614209747/">Screenshot</a> oben). Aber der Editor ist ja auch noch Alpha, das Teil wird sicher noch verbessert.</p>
<p>Die dann an meinem Mac erstellt Version ließ sich auch problemlos in OpenProcessing öffnen (siehe <a href="https://www.flickr.com/photos/schockwellenreiter/55615374503/">Bannerbild</a> ganz oben).</p>
<p>Natürlich wollt und sollt Ihr wissen, was ich da eigentlich angestellt habe. Zuerst habe ich eine Klasse <code>Ball</code>angelegt:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> colors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e66037cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#112a6acc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-2">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#b77440cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d4fb45cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-3">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fc4bc8cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#9f35e9cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-4">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#39da38cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#ef2200cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-5">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#4e942acc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#43fed3cc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-6">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#4a8fbacc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#3463eacc"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Ball {</span>
<span id="cb1-9"></span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">constructor</span>() {</span>
<span id="cb1-11">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-12">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-13">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-15">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createVector</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-16">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-17">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-18">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createVector</span>(dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> dy)</span>
<span id="cb1-19">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">random</span>(colors)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-20">  }</span>
<span id="cb1-21"></span>
<span id="cb1-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>() {</span>
<span id="cb1-23">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-24">  }</span>
<span id="cb1-25"></span>
<span id="cb1-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">checkBoundaries</span>() {</span>
<span id="cb1-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> width <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb1-28">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-29">    }</span>
<span id="cb1-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> height <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r</span>) {</span>
<span id="cb1-31">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-32">    }</span>
<span id="cb1-33">  }</span>
<span id="cb1-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">display</span>() {</span>
<span id="cb1-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fill</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">strokeWeight</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-37">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">circle</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pos</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">this</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">d</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb1-38">  }</span>
<span id="cb1-39">  </span>
<span id="cb1-40">}</span></code></pre></div></div>
<p>Die Klasse besitzt einen Positionsvektor (<code>pos</code>) und einen Geschwindigkeitsvektor (<code>vel</code> für <em>Velocity</em>). Das ist vielleicht ein wenig mit Kanonen auf Spatzen geschossen, aber ich liebe es nun einmal, mit Vektoren zu hantieren. Dadurch müssen in der <code>update()</code>-Methode nur die beiden Vektoren addiert werden.</p>
<p>Die Methode <code>checkBoudaries()</code> prüft, ob die Ränder berührt werden (Überraschung!). Um das möglichst genau hinzubekommen, wird dabei der Radius der Bälle berücksichtigt. Werden die Ränder getroffen, wird die Geschwindigkeit einfach umgekehrt (<code>vel *= -1</code>).</p>
<p>Wo ich die Farbpalette her hatte, weiß ich nicht mehr, aber mir gefallen die Farben mit ihrer leichten Transparenz für die Bälle.</p>
<p>Dadurch, dass die Klasse Ball eine eigene <code>update()</code>-, <code>checkBoundaries()</code>- und eine eigene <code>display()</code>-Methode besitzt, ist der Hauptsketch ziemlich kurz geraten:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> numBalls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> balls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setup</span>() {</span>
<span id="cb2-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas = createCanvas(640, 400);   // für das Einbinden</span></span>
<span id="cb2-7">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas.parent("myCanvas");         // in diese Webseite</span></span>
<span id="cb2-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-9">}</span>
<span id="cb2-10"></span>
<span id="cb2-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">draw</span>() {</span>
<span id="cb2-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">background</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">234</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">218</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">184</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-13">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> ball <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">of</span> balls) {</span>
<span id="cb2-14">    ball<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">display</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-15">    ball<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-16">    ball<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">checkBoundaries</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-17">  }</span>
<span id="cb2-18">}</span>
<span id="cb2-19"></span>
<span id="cb2-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>() {</span>
<span id="cb2-21">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> ball <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ball <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> numBalls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ball<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb2-22">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Ball</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-23">    balls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>(b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-24">  }</span>
<span id="cb2-25">}</span>
<span id="cb2-26"></span>
<span id="cb2-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mousePressed</span>() {</span>
<span id="cb2-28">  balls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Array leeren</span></span>
<span id="cb2-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reset</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb2-30">}</span></code></pre></div></div>
<p>Bemerkenswert ist hier nur die Funktion <code>reset()</code>, die nicht nur die initiale Füllung des Arrays <code>balls[]</code> vornimmt, sondern nach einem Mausklick den Sketch auch neu startet. Hierbei ist interessant, dass man mit dem Setzen eines Arrays auf die Länge von Null (<code>balls.length = 0;</code>) dieses Array komplett leert.</p>
<p>Nun sollt Ihr die hüpfenden Bälle auch auf dieser Seite bewundern können:</p>
<div id="myCanvas">

</div>
<p>Wenn Ihr mit der Maus in den Sketch klickt, werden neue Bälle erzeugt und auf die hüpfende Reise geschickt. Probiert das ruhig aus.</p>
<p>Den Sketch habe ich <a href="https://kantel.github.io/posts/2026080501_running_orcs/">wie hier beschrieben</a> mit <code>&lt;div id="myCanvas"&gt;&lt;/div&gt;</code> in diese Seite eingebunden. Lediglich die <code>class="if16_9"</code> habe ich weggelassen, da sie den eingebundenen Sketch doch nicht responsiv macht. (Wer hierfür eine Lösung weiß, die oder den bitte ich um Mitteilung in meinen Kommentaren.)</p>
<p>Damit das Einbinden funktioniert, müssen in <code>sketch.js</code> die Zeile</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>durch die oben auskommentierten Zeilen</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode numberSource js number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb4-1">canvas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createCanvas</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-2">canvas<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parent</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"myCanvas"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>ersetzt werden.</p>
<p>Natürlich gibt es diesen Sketch auch auf <a href="https://openprocessing.org/@jkantel/3043956">OpenProcessing</a> und im neuen, noch im Alpha-Stadium sich befindenden <a href="https://editor-op.p5js.org/jkantel/sketches/3043956">P5.js Webeditor</a>. Und auch auf meiner Neocities-P5.js-Spielwiese ist <a href="https://kantel.neocities.org/p5projects/Bouncing%20Balls/">der Sketch zu finden</a>.</p>
<p>Wer es mehr traditionell mag: <a href="https://github.com/kantel/p5js/tree/master/bouncingballs01">Hier gibt es den Code</a> auch auf GitHub.</p>
<section id="wie-geht-es-mit-dem-p5.js-webeditor-weiter" class="level2">
<h2 class="anchored" data-anchor-id="wie-geht-es-mit-dem-p5.js-webeditor-weiter">Wie geht es mit dem P5.js Webeditor weiter?</h2>
<p>Nach dem Ende der öffentlichen Testphase gibt es demnächst einen nicht öffentlichen Mitarbeiter- und Wartungstest.</p>
<p>Danach soll die vollständige Umstellung auf das neue OpenProcessing-Backend erfolgen (frühestens am <strong>15.&nbsp;Dezember&nbsp;2026</strong>) und alle Konten werden migriert. Dabei bleiben OpenProcessing.org und der P5.js-Webeditor separate Tools. Diese Zusammenarbeit betrifft ausschließlich die Backend-Prozesse des P5.js-Editors. Die Umstellung erfolgt automatisch. Wer dies nicht will, sollte seine Sketche vorher herunterladen, woanders hosten und sie danach im Webeditor löschen.</p>
<p>Es gibt folgende zukünftige Änderungen und Versprechen bezüglich der Datenschutzrichtlinien und der Nutzungsbedingungen:</p>
<ul>
<li>Eure Sketche und Kontoinformationen werden von OpenProcessing gespeichert.</li>
<li>Die Processing Foundation wird zu <em>Fathom Analytics</em> wechseln, das <a href="https://usefathom.com/why-fathom-analytics/privacy-focused-web-analytics">keine Cookies</a> für Webanalysen verwendet.</li>
<li>Die Processing Foundation wird Dienste entfernen, die sie nicht mehr nutzt.</li>
<li>Die Processing Foundation wird die Datenschutzrichtlinie präzisieren, um genau festzulegen, welche Daten sie erheben und welche nicht.</li>
</ul>
<p>Die Seite mit der <a href="https://discourse.processing.org/t/the-p5-js-editor-is-moving-to-a-new-backend-help-us-test-it/49748">Ankündigung des Wechsels auf das neue Backend</a> wird regelmäßig aktualisiert werden, um auf neu aufkommende Fragen einzugehen.</p>
</section>
<section id="p5.js-und-vscodium" class="level2">
<h2 class="anchored" data-anchor-id="p5.js-und-vscodium">P5.js und VSCodium</h2>
<p>Doch wartet, da ist noch mehr:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55613119827/"><img src="https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/images/vscodium.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Bouncing Balls in VSCodium</figcaption>
</figure>
</div>
<p><a href="https://kantel.github.io/posts/2026080501_running_orcs/">Hier</a> hatte ich ja mit P5.js und dem Editor <a href="https://phcode.io/">Phoenix Code</a> experimentiert. Im Großen und Ganzen erfüllte er <a href="https://kantel.github.io/posts/2026073001_phoenix_code/">meine an ihn gestellten Erwartungen</a>, Lediglich eine Syntax-Hervorhebung und eine Fehlererkennung für P5.js, wie sie <a href="https://github.com/antiboredom/p5.vscode#readme">p5.vscode</a>, eine Erweiterung für <a href="http://cognitiones.kantel-chaos-team.de/produktivitaet/visualstudiocode.html">Visual Studio Code</a>, bietet, hatte ich vermisst. Nicht, dass ich mit Visual Studio Code unzufrieden wäre, aber ich habe mehr und mehr die Befürchtung, dass sich die ganzen Erweiterungen irgendwann einmal in die Quere kommen. Daher habe ich es einmal mit <a href="https://vscodium.com/">VSCodium</a>, der freien (MIT-Lizenz), zu Visual Studio Code weitestgehend kompatiblen, aber weniger geschwätzigen Alternative probiert.</p>
<p>Als Erweiterung habe ich den <a href="https://marketplace.visualstudio.com/items?itemName=Irti.p5js-project-generator">p5.js 2.x Project Generator</a> und den <a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">VS Code Live Server</a> installiert (beides hat mir VSCodium vorgeschlagen).</p>
<p>Ich muss gestehen, ich bin begeistert: Keine Abhängigkeit von Microsoft mehr, kein Editor, der ungefragt nach Hause telephoniert, und die gewohnten Syntax-Hervorhebungen und Fehlererkennung auch für P5.js.</p>
<p>So schön OpenProcessing und der P5.js Webeditor auch sind: Sie liegen auf US-amerikanischen Servern und das steht einer Digitalen Souveränität im Wege. Daher freue ich mich, mit VSCodium einen Schritt weiter in Richtung meiner digitaler Unabhängigkeit gekommen zu sein.</p>


</section>

 ]]></description>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>OpenProcessing</category>
  <category>Nature of Code</category>
  <category>Creative Coding</category>
  <category>VSCodium</category>
  <category>Digitale Souveränität</category>
  <guid>https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/</guid>
  <pubDate>Tue, 27 Oct 2026 12:40:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102701_p5js_webeditor_neu/images/openprocessing.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Geschichte(n) aus der Nachbarschaft: Sie wollten leben!</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102201_sie_wollten_leben/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55605382086/"><img src="https://kantel.github.io/posts/2026102201_sie_wollten_leben/images/arnoalthoff-b.jpg" class="img-fluid"></a></p>
<p>Vor 85 Jahren, am 18. Oktober 1941, fand die erste Deportation von Jüdinnen und Juden aus Berlin statt. Etwa 1.030 Menschen wurden aus einem Sammellager in Moabit quer durch die Stadt zum Bahnhof Grunewald getrieben und dort vom Gleis 17 abtransportiert. Der Theatermacher <em>Günter Jeschonek</em> hat aus diesem Anlass 25&nbsp;Litfaßsäulen in ganz Berlin unter dem Motto »<strong>Sie wollten Leben</strong>« aufgestellt, um explizit an 80 Schicksale zu erinnern.</p>
<p>Zwei dieser Stelen stehen noch bis Mitte November in Neukölln. Eine vor dem Rathaus und eine am S-Bahnhof Hermannstraße. Die Abendschau berichtete darüber in der Sendung am 15.10.2026 um 19:30 Uhr. Zwei zwei dieser Biographien wurden von <em>Karin Kuhrt</em> recherchiert, Mitglied des Bürgervereins <a href="https://proneubritz.jimdofree.com/"><strong>proNeubritz e.V.</strong></a> und für die Recherche etlicher in Neubritz verlegter Stolpersteine verantwortlich. Aus diesem Anlass wird die diesjährige <strong>Stolpersteinführung und Putzaktion</strong> von proNeubritz am 9.&nbsp;November&nbsp;2026 um 18:00&nbsp;Uhr nicht – wie in <a href="https://kantel.github.io/posts/2023111001_stolpersteine_2023/">all den</a> <a href="https://kantel.github.io/posts/2025091401_stolpersteine/">Jahren</a> <a href="https://kantel.github.io/posts/2025110401_stolpersteinf%C3%BChrung/">zuvor</a> – am U-Bahnhof Grenzallee, sondern am S-Bahnhof Hermannstraße beginnen.</p>
<p><strong>Ort und Zeit</strong>: <strong>Stolpersteinführung und Putzaktion</strong>, veranstaltet von proNeubritz e.V., am <strong>9.&nbsp;November&nbsp;2026 um 18:00&nbsp;Uhr</strong> am S-Bahnhof Hermannstraße, <strong>Treffpunkt</strong> an der Litfaßsäule Hermannstraße/Ecke Siegfriedstraße, gegenüber der Postfiliale.</p>
<p><strong>Caveat</strong>: Ich bin im Vorstand von proNeubritz e.V. und an der Planung und Durchführung dieser Stolpersteinführung und Putzaktion beteiligt.</p>
<hr>
<p><strong>Photo</strong> (<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">cc</a>) 2026: <em><a href="http://cognitiones.kantel-chaos-team.de/cv.html">Jörg Kantel</a></em></p>



 ]]></description>
  <category>Geschichte</category>
  <category>Neukölln</category>
  <guid>https://kantel.github.io/posts/2026102201_sie_wollten_leben/</guid>
  <pubDate>Thu, 22 Oct 2026 17:55:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102201_sie_wollten_leben/images/arnoalthoff.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>PHP2Shell: Zwei extrem gefährliche Sicherheitslücken in PHP</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102101_php2shell/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55603682674/"><img src="https://kantel.github.io/posts/2026102101_php2shell/images/php2shell-b.jpg" class="img-fluid"></a></p>
<p>Diese Sicherheitswarnung hat es in sich: So gut wie alle derzeit noch genutzten PHP-Server – zurück bis zum vor mehr als 20 Jahren veröffentlichten PHP&nbsp;5 – lassen sich einfach übernehmen. Und auf PHP basiert heutzutage ein Großteil des gesamten Internets, da fast 80&nbsp;Prozent aller Webseiten mit PHP betrieben werden. Daher gingen schon im Vorfeld zahlreiche Webseiten aus Sicherheitsgründen offline. In Berlin und Brandenburg waren das laut <a href="https://www.rbb24.de/panorama/beitrag/2026/10/it-sicherheitsbehoerde-bsi-kritische-schwachstelle-webanwendunge.html">Informationen von RBB24</a> unter anderem das Robert-Koch-Institut (RKI), die Berliner Tafel, Bündnis 90/Die Grünen, die Universität Potsdam, die <a href="https://www.rbb24.de/wirtschaft/beitrag/2026/10/charite-berlin-website-down-sicherheit-it-medizin.html">Charité</a> - aber auch die Bundespolizei, der Zoll und das Bundesinnenministerium (BMI).</p>
<p>Und wie der österreichische <a href="https://www.derstandard.de/story/3000000345274/warnung-vor-extrem-gefaehrlichen-php-luecken-sorgt-fuer-viel-aufregung-im-web">Standard berichtete</a>, war schon im <a href="https://arstechnica.com/security/2026/10/php-maintainers-tell-web-devs-to-prepare-themselves-for-critical-security-patches/">Vorfeld war laut Arstechnica ein Video im Umlauf</a>, das zeigte, wie mithilfe der beiden Lücken Server mit viel genutzter Software wie WordPress, MediaWiki, Drupal oder auch phpBB übernommen werden können. Der parallel dazu aufgetauchte Name »PHP2Shell« verweist wiederum auf exakt diesen Umstand – also das man so einfach unberechtigten Shellzugriff auf Server erhalten kann.</p>
<p>Seit heute um 16:00 Uhr <a href="https://www.php.net/archive/2026.php#2026-10-21-5">veröffentlicht das PHP-Projekt</a> nun Updates für alle noch unterstützten Versionen der Software als auch Details zu den Sicherheitslücken. Die neuen, fehlerbereinigten Versionen sind 8.5.12, 8.4.27, 8.3.36 und 8.2.35. Für die SysAdmins der betroffenen Server sind nun Überstunden angesagt.</p>
<p>Der <strong>Schockwellenreiter</strong> ist davon nicht betroffen, da er seit Jahren als statische Site betrieben wird und die alte WordPress-Version schon 2012 vom Netz genommen wurde. Auch wenn der Schritt damals viel belächelt wurde, ich bin froh, vor etwa 15 Jahren diese Entscheidung getroffen zu haben.</p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55603682674/">PHP2Shell</a></em>, erstellt mit <a href="http://cognitiones.kantel-chaos-team.de/technikgeschichte/rechnerundnetze/scenario.html">Scenario</a>, Prompt: »<em>A horror clown sits at a desk in front of a computer, grinning diabolically. He operates the mouse with his right hand, while holding a bottle of whiskey in his left. Through a large window in the background, a stormy night sky—complete with rain, lightning, and thunder—is visible. On the wall hangs a poster that reads: “PHP ist böse! Überstunden für SysAdmins!” Franco-Belgian comic book style. Language: German; no speech bubbles, no text boxes, no headings.</em>« Modell: Nana Banana&nbsp;2.1.</p>



 ]]></description>
  <category>Security</category>
  <category>Webworking</category>
  <guid>https://kantel.github.io/posts/2026102101_php2shell/</guid>
  <pubDate>Wed, 21 Oct 2026 14:40:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102101_php2shell/images/php2shell.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>L5: Processing in Lua</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026102001_l5_processing_in_lua/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55601649401/"><img src="https://kantel.github.io/posts/2026102001_l5_processing_in_lua/images/l5-b.jpg" class="img-fluid"></a></p>
<p>Auf <a href="https://www.youtube.com/watch?v=d9pSbNAfiiM">diesem Video</a> der <em>Processing Foundation</em> vom 22. September letzten Monats ist mir gestern <strong><a href="https://l5lua.org/">L5</a></strong> untergekommen. Und ich muss gestehen, das kannte ich bisher noch nicht. Aber da ich die Idee interessant und spannend fand, habe ich gleich ein wenig nachgeforscht. Also, was ist L5?</p>
<p>In kurz und in den Worten der Macher: L5 ist eine unterhaltsame, schnelle, plattformübergreifende und ressourcenschonende Implementierung der <a href="https://processing.org/">Processing API</a> in <a href="https://www.lua.org/">Lua</a>. Es handelt sich um eine kostenlose Open-Source-Bibliothek (LPGL-2.1-Lizenz) zur Erstellung interaktiver Kunstwerke am Computer, die sich an Künstler, Designer und alle richtet, die flexibel Prototypen für Kunst, Spiele, Spielzeug und andere Softwareexperimente in Code entwickeln möchten.</p>
<p>L5 bringt die vertraute Programmierumgebung Processing nach Lua und vereint die besten Eigenschaften von Processing und <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> mit eigenen Besonderheiten. Vorkenntnisse in Processing sind für den Einstieg in L5 nicht erforderlich. L5 basiert auf dem <a href="http://cognitiones.kantel-chaos-team.de/multimedia/spieleprogrammierung/loeve.html">LÖVE-Framework</a>, das ich hier <a href="https://kantel.github.io/posts/2024042103_legend_of_lua/">schon einmal vorgestellt</a> hatte, und bietet nahezu sofortige Ladezeiten sowie hervorragende Performance. L5 ist keine offizielle Implementierung von Processing oder der <em>Processing Foundation</em>, sondern ein Community-Projekt.</p>
<p>Die L5-Community fühlt sich dem Prinzip des <a href="https://en.wikipedia.org/wiki/Permacomputing">Permacomputing</a> verpflichtet, daher läuft L5 nicht nur schnell auf modernen Rechnern, sondern ist auch für ältere und leistungsschwächere Geräte optimiert. Der Ressourcenverbrauch wird minimiert, damit kreatives Programmieren für alle zugänglich bleibt. Dies unterstützt unser Ziel, robuste und langlebige Softwareprojekte zu entwickeln. L5 basiert auf <a href="https://de.wikipedia.org/wiki/Lua">Lua</a>, einer leistungsfähigen und dennoch ressourcenschonenden, extrem schnellen und erweiterbaren Sprache, die auf Desktop-Computern, Smartphones und Tablets funktioniert.</p>
<section id="links" class="level3">
<h3 class="anchored" data-anchor-id="links">Links</h3>
<ul>
<li><a href="https://l5lua.org/">L5 Home</a></li>
<li><a href="https://github.com/L5lua/L5">L5 @ GitHub</a></li>
<li><a href="https://notapipe.itch.io/l5">L5 @ Itch.io</a></li>
<li><a href="https://permacomputing.net/L5/">L5 @ Permacomputing.net</a></li>
</ul>
</section>
<section id="literatur" class="level3">
<h3 class="anchored" data-anchor-id="literatur">Literatur</h3>
<ul>
<li>Lee Tusman: <em><a href="https://leetusman.com/nosebook/early-alpha-feedback-L5">L5: a New Creative Coding Library in Lua, in the family of Processing/p5 Languages</a></em>, 13. Dezember 2025</li>
</ul>
<p><strong>Es ist faszinierend</strong>: <a href="https://kantel.github.io/#category=TIC-80">TIC-80</a> basiert auf Lua (ebenso wie das kommerzielle Pico-8), LÖVE basiert auf Lua und nun der Processing-Ableger L5. <em>So viel zu spielen, so wenig Zeit!</em></p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55601649401/">Falling in LÖVE with Lua</a></em>, erstellt mit <a href="https://openart.ai/home">OpenArt</a>. Prompt: »<em><span class="citation" data-cites="Qumbo">@Qumbo</span> sits at a desk in front of an old-fashioned computer. On the monitor, one can see graphic figures in vivid colors. <span class="citation" data-cites="Qumbo">@Qumbo</span> is wearing reading glasses. He operates the mouse with his right hand. On the desk sits a steaming mug of coffee; the mug bears the inscription “I love Lua!” On the other side of the desk stands another mug, stuffed with writing implements. In the background, there are shelves filled with books on programming and creative coding. Tucked among the books are several figures from computer games. In an open space between the shelves hangs a colorful poster with the inscription “Falling in LÖVE with Lua.” Colored Franco-Belgian comic style. Language: German. No speech bubbles, no text boxes, no headlines.</em>« Modell: Nano Banana&nbsp;2.</p>


</section>

 ]]></description>
  <category>L5</category>
  <category>Lua</category>
  <category>Processing</category>
  <category>Löve</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026102001_l5_processing_in_lua/</guid>
  <pubDate>Tue, 20 Oct 2026 15:10:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026102001_l5_processing_in_lua/images/l5.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Neuköllner Bilderbogen: Goldener Oktober im Carl-Weder-Park</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101901_goldener_oktober/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55598109862/"><img src="https://kantel.github.io/posts/2026101901_goldener_oktober/images/herbst-b.jpg" class="img-fluid"></a></p>
<p>Wie schon in <a href="https://kantel.github.io/posts/2023101601_herbstfarben/">all</a> <a href="https://kantel.github.io/posts/2023103001_buntes_neukoelln/">den</a> Jahren <a href="https://kantel.github.io/posts/2025102701_herbst_carl_weder_park/">zuvor</a>, habe ich auch in diesem Jahr wieder versucht, das herbstlich bunte Laub des <a href="https://de.wikipedia.org/wiki/Carl-Weder-Park">Carl-Weder-Parks</a> in meiner Nachbarschaft mit der Kamera aufzunehmen. Und das sonnige Oktoberwetter machte es mir heute wirklich einfach. Die eingefangenen Farben zeigen doch deutlich, was ein goldener Oktober ist und wie schön er sein kann.</p>
<hr>
<p><strong>Photo</strong> (<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">cc</a>) 2026: <em><a href="http://cognitiones.kantel-chaos-team.de/cv.html">Jörg Kantel</a></em></p>



 ]]></description>
  <category>Neukölln</category>
  <category>Neuköllner Bilderbogen</category>
  <category>Parks und Gärten</category>
  <category>Photographie</category>
  <guid>https://kantel.github.io/posts/2026101901_goldener_oktober/</guid>
  <pubDate>Mon, 19 Oct 2026 17:45:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101901_goldener_oktober/images/herbst.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Wieder etwas zu spielen: Universal-LPC-Spritesheet-Character-Generator</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101801_spritesheet_generator/</link>
  <description><![CDATA[ 




<p><a href="https://github.com/LiberatedPixelCup/Universal-LPC-Spritesheet-Character-Generator/blob/master/readme-images/example.png"><img src="https://kantel.github.io/posts/2026101801_spritesheet_generator/images/example-b.jpg" class="img-fluid"></a></p>
<p>Via <em>Franks Laboratory</em> auf YouTube kam mir der <a href="https://liberatedpixelcup.github.io/Universal-LPC-Spritesheet-Character-Generator/">Universal LPC Spritesheet Generator</a> unter. Das ist ein freier (GPL) Pixel-Generator (<a href="https://github.com/liberatedpixelcup/Universal-LPC-Spritesheet-Character-Generator">Quellcode auf GitHub</a>) für <img src="https://latex.codecogs.com/png.latex?32">x<img src="https://latex.codecogs.com/png.latex?32"> Pixel große Spielefiguren, der ursprünglich für den <a href="https://lpc.opengameart.org/">Liberated Pixel Cup</a> (LPC) entwickelt wurde. Das LPC ist ein Gemeinschaftsprojekt zahlreicher Pixel-Künstler, die Sprites dafür erstellt haben.</p>
<iframe class="if16_9" src="https://www.youtube.com/embed/U-i-SglFpKg?si=OS6Ko9CTbaPH138o" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="">
</iframe>
<p>Mit diesem kostenlosen, browserbasierten Sprite-Generator könnt Ihr und kann ich tausende vollständig animierte, handgezeichnete Charaktergraphiken erstellen – ganz ohne Zeichenkenntnisse, Photoshop/Gimp oder den Kauf von Asset-Paketen.</p>
<p>Das Tool kontentriert sich zwar zwar auf Charakter-Sprites, LPC enthält aber auch viele Tilesets und andere Graphiken. Diese Tileset-Sammlungen findet Ihr auf <a href="https://opengameart.org/lpc-art-entries">OpenGameArt.org</a>.</p>
<p>Die Lizensierung ist etwas kompliziert, da die einzelnen Künstler ihre (Teil-) Bilder zwar unter offenen, aber teilweise unterschiedlichen Lizenzen veröffentlicht haben und sie (zu Recht) genannt werden wollen. Jedoch könnt Ihr bei der Verwendung des Generators eine Textdatei im CSV- oder Klartextformat mit herunterladen, die alle Lizenzinformationen der in Eurem Spritesheet ausgewählten Elemente enthält.</p>
<p><strong>War sonst noch was?</strong> Ach ja, wegen freier Tile- und Spritesets noch dieses: Kenneys <img src="https://latex.codecogs.com/png.latex?16">x<img src="https://latex.codecogs.com/png.latex?16"> Pixel große <a href="https://kenney.nl/assets/series:Tiny">Tiny-Serie</a> hat in diesem Jahr mit der <a href="https://kenney.nl/assets/tiny-farm">Tiny Farm</a> und der <a href="https://kenney.nl/assets/tiny-factory">Tiny Factory</a> zwei Erweiterungen spendiert bekommen. Wie alles von Kenney sind auch diese Erweiterungen Public Domain (<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>).</p>
<iframe class="if16_9" src="https://www.youtube.com/embed/orvi9o88xyY?si=jT9hlip1f2zo8rBj" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="">
</iframe>
<p>Und auf <em>Franks Laboratory</em> findet Ihr auch den <a href="https://www.youtube.com/playlist?list=PLYElE_rzEw_tjnJ_5gzRw0ZM5HRn7AIS0">Vanilla JavaScript Game Development Course</a>. Das ist eine Playlist mit (aktuell!) 17 Videos, die Euch zeigen will, wie Ihr ein Vanilla JavaScript Game Starter Kit von Grund auf mit reinem JavaScript und dem HTML Canvas erstellt. Zwar habe ich mir vorgenommen, in Sachen JavaScript im Allgemeinen und Spieleentwicklung mit JavaScript im Besonderen, mich auf <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a> zu <a href="https://kantel.github.io/posts/2026101501_q5_webeditor_v2/">konzentrieren</a>, aber ich bin mir dennoch sicher, dass ich von dieser Playlist viel lernen kann. <em>Still digging!</em></p>



 ]]></description>
  <category>Spieleprogrammierung</category>
  <category>Tiles und Sprites</category>
  <category>JavaScript</category>
  <category>P5.js</category>
  <category>Retrogaming</category>
  <guid>https://kantel.github.io/posts/2026101801_spritesheet_generator/</guid>
  <pubDate>Sun, 18 Oct 2026 15:00:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101801_spritesheet_generator/images/example.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Caturday: Zeit für ein neues Pussy Pic</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101701_caturday/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55593191008/"><img src="https://kantel.github.io/posts/2026101701_caturday/images/queenjeanie-b.jpg" class="img-fluid"></a></p>
<p>Heute ist wieder <a href="https://knowyourmeme.com/memes/caturday">Caturday</a> und daher Zeit für ein neues Katzenbild. Das heutige <em>Pussy Pic</em> zeigt <em>Her Majesty Jeanie</em> kurz bevor sie ihren Hof betritt.</p>
<p>Aus diesem Anlaß hat sie <del>ein Geschirr angelegt bekommen</del> sich in Schale geschmissen.</p>
<hr>
<p><strong>Photo</strong> (<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">cc</a>) 2026: <em><a href="http://cognitiones.kantel-chaos-team.de/cv.html">Jörg Kantel</a></em></p>



 ]]></description>
  <category>Modernes Leben</category>
  <category>Photographie</category>
  <guid>https://kantel.github.io/posts/2026101701_caturday/</guid>
  <pubDate>Sat, 17 Oct 2026 14:30:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101701_caturday/images/queenjeanie.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Staatstrojaner via Online-Werbung: Adblocker sind Notwehr</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101601_adblocker_sind_notwehr/</link>
  <description><![CDATA[ 




<p><a href="https://www.flickr.com/photos/schockwellenreiter/55593212316/"><img src="https://kantel.github.io/posts/2026101601_adblocker_sind_notwehr/images/adblocker-b.jpg" class="img-fluid"></a></p>
<p>Ich hatte es – glaube ich – vor etwa zehn Jahren schon behauptet: »<a href="http://blog.schockwellenreiter.de/2016/12/2016120501.html">Adblocker sind Notwehr!</a>« Jetzt bestätigt auch Netzpolitik.org, dass »<a href="https://netzpolitik.org/2026/werbeblocker-obligatorisch-geraete-lassen-sich-ohne-klick-per-werbeanzeige-hacken/">Werbeblocker obligatorisch</a>« seien. Denn in einer großangelegten Recherche <a href="https://www.tagesschau.de/investigativ/br-recherche/spionage-software-werbung-100.html">zusammen mit dem Bayerischen Rundfunk</a> hatten sie herausgefunden, daß sich Geräte »ohne Klick per Werbeanzeige hacken« ließen:</p>
<blockquote class="blockquote">
<p>Erstmals konnten IT-Forscher*innen des Citizen Lab von der Universität Toronto technisch nachvollziehen, wie Angreifer Geräte per Online-Werbung hacken – ohne dass Opfer einen Klick machen müssen. Sobald eine bösartige Werbeanzeige auf dem Bildschirm eines Handys oder Rechners erscheint, soll es bereits zu spät sein, und das Gerät wird mit Spionage-Software infiziert. Die Forschenden nennen diese Art des Angriffs »AdFection«, ein Kofferwort aus »Ad« (Werbung) und Infektion.</p>
</blockquote>
<p>Im Fokus der <a href="https://citizenlab.ca/research/how-discover-tech-turned-targeted-ads-into-a-pipeline-for-spyware/">Untersuchung</a> stand die israelische Firma Discover-Tech Ltd., die sich jahrelang als harmlose Werbebude ausgegeben hatte. Die Forscherinnen und Forscher gehen mit »hoher Sicherheit« davon aus, dass Angreifer mit Hilfe von Discover-Tech Trojaner der Firma Candiru über bösartige Werbeanzeigen verteilt haben sollen.</p>
<p>Ganz ohne Klick der überrumpelten Nutzerinnen und Nutzer scheint es aber immer noch nicht gegangen zu sein. Irgendwann im Vorfeld muss schon eine Interaktion mit dem Werbenetzwerk stattgefunden haben, nur eben nicht bei der manipulierten Anzeige. Und nachweisen konnte Citizen Lab die Infektion bisher nur via Windows, in wieweit auch Android- oder iOS-Geräte gehackt werden könnten, darauf ging Citizen Lab nicht ein.</p>
<p>Ich bin nicht so optimistisch, wie der Wiener Forscher <em>Wolfie Christl</em>, Co-Autor der Untersuchung des Citizen Lab, der ein Ende der Online-Werbung voraussagte, aber ich stimme ihm in der Aussage zu:</p>
<blockquote class="blockquote">
<p>Die Art, wie Online-Werbung heute funktioniert, ist ein einziges Sicherheitsrisiko – für Staaten, den privaten Sektor, Zivilgesellschaft und für alle anderen. […] Es ist schwierig, wenn nicht fast unmöglich, sich zuverlässig vor bösartigen Werbeanzeigen zu schützen. Unsere Forschung bestätigt einmal mehr: Das Blockieren von Online-Werbung ist für die IT-Sicherheit obligatorisch.</p>
</blockquote>
<p>Das bedeutet: Wer keinen Adblocker einsetzt, handelt fahrlässig. Und der Versuch einiger Browserhersteller (Google!), Adblocker zu blockieren, kann nur als bösartig und gefährlich bezeichnet werden. Diese Firmen opfern die Sicherheit ihrer Nutzer auf dem Altar der Profitgier.</p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55593212316/">Adblocker sind Notwehr</a></em>, erstellt mit <a href="http://cognitiones.kantel-chaos-team.de/technikgeschichte/rechnerundnetze/scenario.html">Scenario</a>. Prompt: »<em>A badger wearing a red dressing gown and reading glasses sits at a desk in front of a computer. Advertising banners are visible on the monitor. A fist emerges from one of these banners and begins to strangle the badger. A white rabbit—dressed in a yellow-checked waistcoat, a blue jacket, and a red-checked bow tie—looks in alarm at a giant pocket watch, crying out, “Zu spät! zu sät!” Behind them stand towering shelves filled with legal literature, along with a statue of Lady Justice. In a gap between the shelves hangs a poster that reads: “Adblocker sind Notwehr!” Franco-Belgian comic book style. Language: German.</em>« Modell: Nano Banana&nbsp;2(.1?).</p>



 ]]></description>
  <category>Security</category>
  <guid>https://kantel.github.io/posts/2026101601_adblocker_sind_notwehr/</guid>
  <pubDate>Fri, 16 Oct 2026 15:40:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101601_adblocker_sind_notwehr/images/adblocker.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Q5 Webeditor v2 veröffentlicht!</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101501_q5_webeditor_v2/</link>
  <description><![CDATA[ 




<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55240540789/"><img src="https://kantel.github.io/posts/2026101501_q5_webeditor_v2/images/q5playpython-b.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Screenshot</figcaption>
</figure>
</div>
<p>Zu <a href="https://q5play.org/home/">Q5.play</a> und <a href="https://q5js.org/home/">Q5.js</a>, der »rasend schnellen Alternative« zu <a href="http://cognitiones.kantel-chaos-team.de/programmierung/creativecoding/processing/p5js.html">P5.js</a>, gibt es auch einen eigenen <a href="https://codevre.com/q5-editor">Webeditor</a>. Und von dem wurde gestern die <a href="https://substack.com/home/post/p-220365525">Version&nbsp;2 freigegeben</a>. Es ist ein größeres Update mit folgenden Änderungen:</p>
<ul>
<li>Lädt 2x schneller,</li>
<li>entwickelt mit <a href="https://github.com/esm-dev/modern-monaco">Modern Monaco</a> (genau wie Visual Studio Code),</li>
<li>Inline-Dokumentation und automatische Vervollständigung für Q5.js und Q5.play,</li>
<li>erstklassiger Support für modernes JavaScript und Python (via <a href="http://cognitiones.kantel-chaos-team.de/programmierung/python/brython.html">Brython</a>).</li>
</ul>
<p>Die Sketche werden jetzt ausgeführt, bevor der Editor geladen wird, so dass Ihr sofort mit dem Sketch interagieren könnt. Außerdem könnt Ihr nun Dateien per Drag-and-Drop in den Editor hochladen.</p>
<p>Zu Q5.play und Q5.js habe ich jedoch ein <a href="https://kantel.github.io/posts/2026043001_q5play_python/">gespaltenes Verhältnis</a>. Eigentlich macht das Teil auf mich einen guten Eindruck und es scheint auch auf einer soliden Grudlage zu stehen. Und so reizt mich vor allem die Möglichkeit, die Q5.play-Bibliothek in Python/<a href="http://cognitiones.kantel-chaos-team.de/programmierung/python/brython.html">Brython</a> zu nutzen, der Python-Version, die auch in <a href="http://cognitiones.kantel-chaos-team.de/multimedia/spieleprogrammierung/microstudio.html">microStudio</a> werkelt. Aber auf der anderen Seite steht das Teil unter einer <a href="https://github.com/q5play/q5play?tab=License-1-ov-file#readme">seltsamen Lizenz</a>. Zwar darf man – außerhalb militärischer Einrichtungen (das ist der Teil der Lizenz, der mir gefällt) – das Teil eigentlich kostenlos nutzen, jedoch wird für die Nutzung in der Ausbildung Knete verlangt. Und da frage ich mich: Ist ein Q5.play-Tutorial, das ich hier auf diesen Seiten veröffentliche »Nutzung in der Ausbildung«? Und was wäre, wenn ich damit einen Volkshochschulkurs anbiete? Daher sind Q5.js und Q5.play für mich momentan keine ernstzumehmenden Alternativen zu (wirklich!) freien Programmen.</p>
<p>Ich werde daher wohl doch – wenn es um JavaScript geht – weiter bei P5.js bleiben müssen, das in der <a href="https://p5js.org/">Version&nbsp;2</a> ja ebenfalls einen gewaltigen Schritt nach vorne gemacht hat. <em>Still digging!</em></p>
<hr>
<p><strong>Bild</strong>: <em><a href="https://www.flickr.com/photos/schockwellenreiter/55240540789/">Q5play kann Python</a></em>, erstellt mit <a href="http://cognitiones.kantel-chaos-team.de/technikgeschichte/rechnerundnetze/scenario.html">Scenario</a>. Prompt: »<em>A badger in a red dressing gown and a python wearing horn-rimmed glasses are sitting together in a classroom in front of a computer, programming games. On the blackboard behind them, written in chalk, are the words: “Spieleprogrammierung mit Q5play und Python”. Colored Franco-Belgian comic style. Language: German. No speech bubbles, no textboxes, no headlines.</em>« Modell: Nano Banana&nbsp;2.</p>



 ]]></description>
  <category>Q5.js</category>
  <category>Q5.play</category>
  <category>P5.js</category>
  <category>JavaScript</category>
  <category>Python</category>
  <category>Brython</category>
  <category>Spieleprogrammierung</category>
  <category>Creative Coding</category>
  <guid>https://kantel.github.io/posts/2026101501_q5_webeditor_v2/</guid>
  <pubDate>Thu, 15 Oct 2026 18:00:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101501_q5_webeditor_v2/images/q5playpython.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Alice und der kleine Drache: Noch mehr über Makros und Hooks in Twine (Harlowe)</title>
  <dc:creator>Jörg Kantel</dc:creator>
  <link>https://kantel.github.io/posts/2026101401_alice_tutorial_7/</link>
  <description><![CDATA[ 




<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55588978683/"><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/drago-b.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Screenshot</figcaption>
</figure>
</div>
<p>In der letzten Woche war es zwar ruhig hier auf diesen Seiten, aber ich habe nicht auf der faulen Haut gelegen. Sondern ich habe mich weiter durch die <a href="https://twine2.neocities.org/">aktuelle Dokumentation</a> des <a href="http://cognitiones.kantel-chaos-team.de/multimedia/spieleprogrammierung/twine2.html">Twine</a>-Storyformats Harlowe gewühlt, um ein weiteres Tutorial für die kleine, freie Engine für interaktive Geschichten (und vielem mehr) zu schreiben. Auch heute geht es in der Hauptsache um (neue) <strong>Makros</strong> und <strong>Hooks</strong>, den kleinen »Haken«, die an den Makros hängen.</p>
<p>Dafür habe ich Alice <a href="https://kantel.github.io/posts/2026091001_alice_tutorial_5/">noch einmal</a> in die Bibliothek geschickt, um dort ein weiteres Abenteuer zu erleben. Doch der Reihe nach:</p>
<p>Auch dieses Mal beginnt die Geschichte mit der Startpassage <code>Init</code>, die außer einer (zufallsgesteuerten) Variablendeklaration die Leserin oder den Leser sofort auf die Passage <code>Start</code> weiterleitet:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb1-1">(set: $key to (either: "unter der Fußmatte", "im Krug", "im Blumentopf"))</span>
<span id="cb1-2"></span>
<span id="cb1-3">(go-to: "Start")</span></code></pre></div></div>
<p>Das Makro <code>either:</code> setzt die Variable <code>$key</code> zufällig auf einen der drei Werte <code>unter der Fußmatte</code>, <code>im Krug</code> oder <code>im Blumentopf</code>. Damit spiele ich auf das Vorgängertutorial an, in dem der Schlüssel ebenfalls zufällig an einem dieser drei Orte versteckt war.</p>
<p>Die eigentlich Geschichte beginnt in der Passage <code>Start</code>, auf die <code>Init</code> mit dem Makro <code>go-to:</code> automatisch weiterleitet.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb2-1"># Alice und der kleine Drache</span>
<span id="cb2-2"></span>
<span id="cb2-3">&lt;img src="images/mansion2.jpg" alt="Das alte Haus" /&gt;</span>
<span id="cb2-4"></span>
<span id="cb2-5">Alice war im Wunderland wieder zum alten Haus mit der Bibliothek unterwegs. Da sie </span>
<span id="cb2-6">wusste, dass der Türschlüssel $key versteckt war, hatte sie keine Schwierigkeiten, in </span>
<span id="cb2-7">das Haus zu kommen.</span>
<span id="cb2-8"></span>
<span id="cb2-9">Sie schloß die [[Tür zur Eingangshalle-&gt;Eingangshalle]] auf.</span></code></pre></div></div>
<p>Hiermit ist die Reminiszens auf den vorherigen Bibliotheksbesuch aber auch schon abgehakt und Alice betritt die Eingangshalle<sup>1</sup>:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55586105617/"><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/entrancehall.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Die Eingangshalle</figcaption>
</figure>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb3-1">&lt;img src="images/entrancehall.jpg" alt="Eingangshalle" /&gt;</span>
<span id="cb3-2"></span>
<span id="cb3-3">Die Eingangshalle war groß und leer. Im Hintergrund gab es eine große, </span>
<span id="cb3-4">repräsentative, aber verfallene Treppe, die auf Alice keinen sicheren Eindruck </span>
<span id="cb3-5">machte und die sie lieber nicht betreten wollte.</span>
<span id="cb3-6"></span>
<span id="cb3-7">Links durch eine offene Tür konnnte sie eine [[Küche-&gt;Küche]] erkennen </span>
<span id="cb3-8">und rechts von ihr war der Eingang zur </span>
<span id="cb3-9">[[alten Bibliothek-&gt;Bibliothek]].</span></code></pre></div></div>
<p>Diese Passage besitzt keine neuen Elemente, also wenden wir uns der <code>Bibliothek</code> zu (die <code>Küche</code> wird später noch einmal besucht und dann in diesem Tutorial behandelt):</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb4-1">&lt;img src="images/library01.jpg" alt="Bibliothek" /&gt;</span>
<span id="cb4-2"></span>
<span id="cb4-3">Alice hatte das Gefühl, dass die Bücherwände ein Geheimnis vor ihr verbargen. </span>
<span id="cb4-4">Sie nahm eines der alten |regal&gt;[Bücher aus dem Regal]. {</span>
<span id="cb4-5">(click:?regal, </span>
<span id="cb4-6">(action: "mouseover"))[Hinter dem Buch war ein Schalter versteckt. Als Alice ihn </span>
<span id="cb4-7">umlegte, schob sich das ganze Regal zur Seite und öffnete eine Tür zu einem </span>
<span id="cb4-8">[[weiteren Raum-&gt;Drache]].]}</span>
<span id="cb4-9"></span>
<span id="cb4-10">Alice sah sich die Regalwände genauer an …</span></code></pre></div></div>
<p>Hier passiert ganz viel Neues: Erst einmal wird, statt eines anonymen Hooks, der einfach an das Makro angehängt wird, ein <a href="https://twine2.neocities.org/#markup_named-hook"><strong>benannter</strong></a> <em>(named)</em> Hook verwendet. Der Name eines Hooks kann entweder mit <code>|name&gt;[zu markierende Textpassage]</code> <strong>vor</strong> dem betreffenden Text, oder mit <code>[zu markierende Textpassage]&lt;name|</code> <strong>nach</strong> dem betreffenden Textteil gesetzt werden. In diesem Fall ist der Name des Hooks <code>regal</code> und er wurde <strong>vor</strong> dem betreffenden Text <code>[Bücher aus dem Regal]</code><sup>2</sup> gesetzt.</p>
<p>Benannte Hooks können dann mit ihrem Namen in der Passage (üblicherweies, aber nicht zwingend am Ende der Passage<sup>3</sup>) aufgelöst werden. Namen werden wie Variablen behandelt, nur dass statt des Dollarsymbols (<code>$</code>) ein Fragezeichen (<code>?</code>) vorangestellt wird. In diesem Fall wird das<a href="https://twine2.neocities.org/#macro_click">Makro <code>click:</code></a> in Kombination mit dem <a href="https://twine2.neocities.org/#macro_action"><code>action:</code>-Makro</a> aufgerufen<sup>4</sup>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb5-1">(click:?regal, (action: "mouseover"))[Hinter dem Buch war ein Schalter </span>
<span id="cb5-2">versteckt. Als Alice ihn umlegte, schob sich das ganze Regal zur Seite und </span>
<span id="cb5-3">öffnete eine Tür zu einem [[weiteren Raum-&gt;Drache]].]</span></code></pre></div></div>
<p><code>mouseover</code>-Links werden in Harlowe bei Default mit einem gestrichelten Unterstrich gekennzeichnet:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/mouseover.jpg" class="img-fluid figure-img"></p>
<figcaption>Mouseover Default</figcaption>
</figure>
</div>
<p>Das war aber nicht das, was ich wollte. Die Spielerin oder der Spieler sollten schon ein wenig suchen, bis sie einen Ausweg aus der Bibliothek finden. Daher habe ich per CSS die Markierung ausgeschaltet:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode numberSource css number-lines code-with-copy"><code class="sourceCode css"><span id="cb6-1">tw-link<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">.enchantment-mouseover</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">.link.enchantment-mouseover</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> </span>
<span id="cb6-2">tw-expression<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">.enchantment-mouseover</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> tw-link {</span>
<span id="cb6-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">border-bottom</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb6-4">}</span></code></pre></div></div>
<p>Dann sieht die Passage nach dem Aufruf so aus:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/mouseovercss.jpg" class="img-fluid figure-img"></p>
<figcaption>Mouseover mit CSS</figcaption>
</figure>
</div>
<p>In beiden Fällen bewirkt aber das Überfahren von »Bücher aus dem Regal«, das ein Stück Text wie von Zauberhand geschrieben, in die Passage hineingemogelt wird:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55586194627/"><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/bibmouseover.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Die Bibliothekspassage nach einem Mouseover</figcaption>
</figure>
</div>
<p>Wenn Ihr Eure Leserinnen und Leser aber nicht vor den Kopf stoßen wollt, solltet Ihr den Trick mit den unsichtbaren Links nur mit Bedacht verwenden. In diesem Fall war es noch recht einfach, da es keinen offensichtlichen Ausgang aus der Passage gab, musste er irgendwo versteckt sein. Also streicht die Nutzerin oder der Nutzer mit der Maus über die Passage (Bild (<a href="https://kantel.github.io/posts/2026081102_imagemaps_twine/">Imagemaps</a>!) <strong>und</strong> Text), in der Hoffnung, irgendwo einen versteckten Ausweg zu finden. Das macht ja geradezu den Reiz einer solchen interaktiven Geschichte aus.</p>
<p>Wurde dann der Ausgang aus der Bibliothek gefunden, trifft Alice auf den kleinen Drachen <em>Drago</em> (Passage: <code>Drache</code>):</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb7-1">{(if: (count: (history:), "Drache") is 0)[&lt;img src="images/drago01.jpg" </span>
<span id="cb7-2">alt="Der hungrige, kleine Drache" /&gt;</span>
<span id="cb7-3"></span>
<span id="cb7-4">In dem Raum saß ein kleiner Drache vor einem Tisch und jammerte laut </span>
<span id="cb7-5">»Ich habe Hunger, bring mir bitte etwas zu essen.«</span>
<span id="cb7-6"></span>
<span id="cb7-7">Alice hatte Mitleid und beschloß, (if: (count: (history:), "Küche") &gt; 0)</span>
<span id="cb7-8">[noch einmal] die [[Küche-&gt;Küche]] aufzusuchen.]</span>
<span id="cb7-9">(else-if: (count: (history:), "Drache") is 1)</span>
<span id="cb7-10">[</span>
<span id="cb7-11">&lt;img src="images/drago02.jpg" alt="Der kleine Drache mit einem Braten" /&gt;</span>
<span id="cb7-12"></span>
<span id="cb7-13">Der kleine Drache bedankte sich artig und begann hungrig, den Truthahn </span>
<span id="cb7-14">zu verspeisen.</span>
<span id="cb7-15"></span>
<span id="cb7-16">Währenddessen sah Alice sich neugierig um und bemerkte eine Tür zu einer </span>
<span id="cb7-17">kleinen [[Abstellkammer-&gt;Kammer]].]</span>
<span id="cb7-18">(else:)[&lt;img src="images/drago03.jpg" alt="Der kleine Drache ist satt" /&gt;</span>
<span id="cb7-19"></span>
<span id="cb7-20">Der kleine Drache saß satt an seinem Tisch und Alice begann ein [[Gespräch-&gt;Gespräch]] </span>
<span id="cb7-21">mit ihm.]}</span></code></pre></div></div>
<p>Alice kann die Passage mehrmals aufsuchen, und jedes Mal ändert sich der Zustand des Drachens (von »hungrig« zu »speisend« zu »satt«). Dies kann man mit einer ziemlich gewagt aussehenden Kombination aus <code>if:</code>, <code>else-if:</code> und <code>else:</code> in Verbindung mit <code>count:</code> und <code>history:</code> abbilden. Die Makros <a href="https://twine2.neocities.org/#macro_if"><code>if:</code></a>, <a href="https://twine2.neocities.org/#macro_else-if"><code>else-if:</code></a> und <a href="https://twine2.neocities.org/#macro_else"><code>else:</code></a> hatte ich <a href="https://kantel.github.io/posts/2026100601_alice_tutorial_6/">im letzten Tutorial</a> schon abgehandelt, neu sind die <code>count:</code>- und <code>history:</code>-Makros:</p>
<p>Das <a href="https://twine2.neocities.org/#macro_count"><code>count:</code>-Makro</a> zählt die Anzahl der Elemente eines Strings oder eines Array<sup>5</sup>. In Verbindung mit dem <a href="https://twine2.neocities.org/#macro_history"><code>history:</code>-Makro</a>, das ein Array aller bisher besuchten Passagen (in diesem Fall mit dem Namen »Drache«) zurückgibt, erfährt Twine, wie oft diese Passage besucht wurde.</p>
<p>Da der aktuelle Besuch (noch) nicht mitgezählt wird, bedeutet <img src="https://latex.codecogs.com/png.latex?0">, dass die Passage zum ersten Mal besucht wurde, <img src="https://latex.codecogs.com/png.latex?1"> gibt es beim zweiten Besuch der Passage und so weiter.</p>
<p>Die Passage <code>Drache</code> zeigt übrigens auch sehr schön, dass jedes <code>if:</code>, <code>else-if:</code> oder <code>else:</code> auch eigene Bilder mitbringen kann.</p>
<p>Da Alice beim zweiten Besuch (wieder?) in die <code>Küche</code> geschickt wird, möchte ich diese Passage als nächstes abhandeln:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb8-1">{(if: (history:) contains "Drache")[Auch die Küche schien ein Geheimnis </span>
<span id="cb8-2">zu verbergen. Vor Alice stand ein großer, leerer Tisch. An der Wand links neben </span>
<span id="cb8-3">ihr hing ein weiterer, großer (link: "Schalter. ")[Schalter.</span>
<span id="cb8-4"></span>
<span id="cb8-5">&lt;img src="images/kitchen02.jpg" alt="Die Küche zaubert" /&gt;</span>
<span id="cb8-6"></span>
<span id="cb8-7">Als Alice ihn umlegte, lag auf dem Tisch wie von Zauberhand ein Teller mit </span>
<span id="cb8-8">einem gebratenen Truthahn. Alice nahm den Teller mit dem Braten und brachte ihn </span>
<span id="cb8-9">zu dem kleinen [[Drachen-&gt;Drache]].] ]</span>
<span id="cb8-10">(else:)[&lt;img src="images/kitchen01.jpg" alt="Die leere Küche" /&gt;</span>
<span id="cb8-11"></span>
<span id="cb8-12">Die Küche machte auf Alice einen schmuddeligen, aber leeren Eindruck. Sie ging </span>
<span id="cb8-13">daher lieber wieder [[zurück in die Eingangshalle-&gt;Eingangshalle]].]}</span></code></pre></div></div>
<p>Auch hier kommt das Makro <code>history:</code> zum Einsatz, allerdings wird hier gefragt, ob das <code>history</code>-Array die Passage <code>Drache</code> enthält (<code>(if: (history:) contains "Drache")</code>). Wenn dies der Fall ist, kommt der erste Teil zum Einsatz, in dem Alice einen Schalter umlegt und so einen Braten auf den Tisch zaubert.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55587540348/"><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/kitchen02.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Alice zaubert einen Braten</figcaption>
</figure>
</div>
<p>In allen anderen Fällen (es gibt in diesem Fall nur einen) kehrt Alice unverrichteter Ding in die Eingangshalle zurück.</p>
<p>Hat Alice dem Drachen den Truthahnbraten gebracht, entdeckt sie eine <code>Kammer</code>, die sie aufsucht:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb9-1">&lt;img src="images/attic.jpg" alt="Die Abstellkammer auf dem Dachboden" /&gt;</span>
<span id="cb9-2"></span>
<span id="cb9-3">Die Abstellkammer war leer und so ging Alice, nachdem sie eine Weile das dort </span>
<span id="cb9-4">liegende Spielzeug inspiziert hatte, wieder zurück in den </span>
<span id="cb9-5">[[Raum mit dem kleinen Drachen-&gt;Drache]].</span></code></pre></div></div>
<p>In dieser Passage passiert wieder nichts Neues, der Zweck ihres Daseins ist nur, dass Alice die Passage <code>Drache</code> zum dritten Mal aufsuchen kann.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://www.flickr.com/photos/schockwellenreiter/55586486482/"><img src="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/drachenbraut.jpg" class="img-fluid figure-img"></a></p>
<figcaption>Feuersalamander und Drachenbraut</figcaption>
</figure>
</div>
<p>Nach dieser Passage kommt Alice mit dem Drachen in ein <code>Gespräch</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb10-1">&lt;img src="images/drachenbraut.jpg" alt="Feuersalamander und Drachenbraut" /&gt;</span>
<span id="cb10-2"></span>
<span id="cb10-3">Der kleine Drache erzählte stolz, dass er Drago heiße und der Sohn eines </span>
<span id="cb10-4">Feuersalamanders sei, der sich in eine Drachenfrau verliebt hätte. Sie habe </span>
<span id="cb10-5">seine Liebe erwidert und dann ein Ei gelegt, aus dem der kleine Drago geschlüpft sei.</span>
<span id="cb10-6"></span>
<span id="cb10-7">Er sei etwas kleiner, als die anderen Drachen und er könne auch kein Feuer </span>
<span id="cb10-8">spucken, aber ansonsten fühle er sich wie die großen Drachen.</span>
<span id="cb10-9"></span>
<span id="cb10-10">[[Weiter …-&gt;Ende]]</span></code></pre></div></div>
<p>Hier erfährt Alice zwar einiges über <em>Dragos</em> Herkunft, aber technisch ist die Passage eigentlich langweilig – es gibt wieder nichts Neues. Aber irgendwann muss die Geschichte ja auch einmal zu einem <code>Ende</code> kommen:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode numberSource text number-lines code-with-copy"><code class="sourceCode"><span id="cb11-1">&lt;img src="images/abschieddrago.jpg" alt="Alice verabschiedet sich von Drago" /&gt;</span>
<span id="cb11-2"></span>
<span id="cb11-3">Alice hörte ihm geduldig zu und bedankte sich für seine Gesellschaft.</span>
<span id="cb11-4"></span>
<span id="cb11-5">Als sie wieder nach Hause ging, hatte sie das Gefühl, einen neuen Freund </span>
<span id="cb11-6">gewonnen zu haben.</span>
<span id="cb11-7"></span>
<span id="cb11-8">Damit ist die heutige Geschichte zu Ende. </span>
<span id="cb11-9">(link: "Noch einmal Spielen?")[(restart:)]</span></code></pre></div></div>
<p>Hier habt Ihr die Möglichkeit, die ganze Geschichte noch einmal zu spielen. Das <code>restart:</code>-Makro setzt alles auf Null, das heißt auch das <code>history</code>-Array wird wieder geleert.</p>
<section id="das-spiel" class="level3">
<h3 class="anchored" data-anchor-id="das-spiel">Das Spiel</h3>
<p>Wie (fast) immer habt Ihr hier die Möglichkeit, die Geschichte von Alice und dem kleine Drachen, eingebettet in diese Seiten, zu spielen:</p>
<iframe width="100%" height="600" src="alice7/">
</iframe>
<p>Auch dieses Tutorial habe ich sowohl als HTML-Datei wie auch als Twee-Datei mit allen Assets (Bilder und Schriften) auf meinem <a href="https://github.com/kantel/twine-entdecken/tree/master/Twine/alicereloadedharlowe/alice7">GitHub-Account hochgeladen</a>. Habt Spaß damit!</p>
<p>Und natürlich habe ich dieses Spielchen – wie die anderen auch – auf meiner <a href="https://kantel.neocities.org/twine/alice7/">Neocities-Spielwiese veröffentlicht</a>. Denn dafür ist meine Spielwiese schließlich da.&nbsp;🤓</p>
</section>
<section id="was-bisher-geschah" class="level2">
<h2 class="anchored" data-anchor-id="was-bisher-geschah">Was bisher geschah</h2>
<p>Meine Twine-Harlowe-Reihe besteht bisher aus diesen zehn Beiträgen (das ist schon ein kleines Jubiläum&nbsp;🎊🎉):</p>
<ol type="1">
<li>Der Wunderland-Debattierclub: <a href="https://kantel.github.io/posts/2026081102_imagemaps_twine/">Klickbare Imagemaps in Twine</a></li>
<li><a href="https://kantel.github.io/posts/2026082001_zurueck_ins_wunderland/">Zurück ins Wunderland (schon wieder)</a> und dieses Mal mit Harlowe</li>
<li>Alles auf Anfang: <a href="https://kantel.github.io/posts/2026082301_twine_harlowe_wunderland/">Mit Twine und Harlowe ins Wunderland</a></li>
<li>Aus meiner Webwerkstatt: <a href="https://kantel.github.io/posts/2026082401_twine_einbinden/">Twine-Stories in die eigenen Seiten einbinden</a></li>
<li><a href="https://kantel.github.io/posts/2026082601_alice_teeparty/">Alice und die Teeparty</a>: Mit Twine und Harlowe ins Wunderland (Teil 2)</li>
<li><a href="https://kantel.github.io/posts/2026090102_alice_und_humpelpumpel/">Alice und Humpel Pumpel</a>: Mit Twine und Harlowe ins Wunderland (Teil 3)</li>
<li><a href="https://kantel.github.io/posts/2026090701_custom_fonts_harlowe/">Qumbo schreibt (schön)</a>: Custom Fonts in Twine (Harlowe)</li>
<li><a href="https://kantel.github.io/posts/2026091001_alice_tutorial_5/">Mit Alice in die Bibliothek</a>: Variablen, Makros und Hooks in Twine (Harlowe)</li>
<li><a href="https://kantel.github.io/posts/2026100601_alice_tutorial_6/">Mit Alice in das Reich der Ringe</a>: Noch mehr zu Variablen, Makros und Hooks in Twine (Harlowe)</li>
<li>Alice und der kleine Drache: Noch mehr über Makros und Hooks in Twine (Harlowe)</li>
</ol>
<p>Fortsetzung folgt …</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Fußnoten</h2>

<ol>
<li id="fn1"><p>Auch die Bilder für dieses Tutorial habe ich von einer gekünstelten Intelligenzia meines Vertrauens (<a href="https://openart.ai/home">OpenArt</a>) generieren lassen. Mit einem Klick auf die Bilder kommt Ihr auf eine Seite, die Euch verrät, welchen Prompt und welches Modell (in diesm Fall Nano Banana&nbsp;2 für alle Bilder) ich gewählt habe.↩︎</p></li>
<li id="fn2"><p>Beachtet, daß auch benannte Hooks mit einfachen, eckigen Klammern (<code>[Hook]</code>) markiert werden müssen.↩︎</p></li>
<li id="fn3"><p>Den letzten, ziemich sinnfreien Satz in der obigen Passage habe ich nur angefügt, um zu zeigen, dass die Auflösung <strong>nicht</strong> am Ende der Passage stattfinden muss.↩︎</p></li>
<li id="fn4"><p>Harlowe besitzt für solche Fälle eigentlich noch ein <a href="https://twine2.neocities.org/#macro_mouseover"><code>mouseover:</code>-Makro</a>, aber das gilt als veraltet und sollte nicht mehr verwendet werden, da es aller Voraussicht nach in Harlowe&nbsp;4.0 gestrichen wird.↩︎</p></li>
<li id="fn5"><p>Über Arrays erzähle ich in einem späteren Tutorial mehr.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Twine</category>
  <category>Harlowe</category>
  <category>Interactive Fiction</category>
  <category>Spieleprogrammierung</category>
  <category>Alice</category>
  <guid>https://kantel.github.io/posts/2026101401_alice_tutorial_7/</guid>
  <pubDate>Wed, 14 Oct 2026 11:50:00 GMT</pubDate>
  <media:content url="https://kantel.github.io/posts/2026101401_alice_tutorial_7/images/drago.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
