<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://peda.net/:static/539/atom.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>24. syyskuuta 2025</title>
<id>https://peda.net/id/d126832a987</id>
<updated>2025-09-23T14:31:16+03:00</updated>
<link href="https://peda.net/id/d126832a987:atom" rel="self" />
<link href="https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025#top" rel="alternate" />
<logo>https://peda.net/:static/539/peda.net.logo.bg.svg</logo>
<rights type="html">&lt;div class=&quot;license&quot;&gt;Tämän sivun lisenssi &lt;a rel=&quot;license&quot; href=&quot;https://peda.net/info&quot;&gt;Peda.net-yleislisenssi&lt;/a&gt;&lt;/div&gt;&#10;</rights>

<entry>
<title>Vibe-coding jatkuu...</title>
<id>https://peda.net/id/fa7a1f10987</id>
<updated>2025-09-24T09:30:14+03:00</updated>
<link href="https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu#top" />
<content type="html">&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;480&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;494&quot;--&gt;1. Aloitus&lt;/h3&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;495&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;495&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;560&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;497&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;560&quot;--&gt;Luo kansio peliä varten omalle koneelle (esim. &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;544&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;558&quot;--&gt;toimintapeli&lt;/code&gt;).&lt;br/&gt;&#10;&lt;span class=&quot;small&quot;&gt;&lt;a href=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-kansio.png#top&quot; title=&quot;toimintapelin_kansio.png&quot;&gt;&lt;img src=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-kansio.png:file/photo/1e0b716dfa91f70d20da1d70e3b1077de6865301/toimintapelin_kansio.png&quot; alt=&quot;&quot; title=&quot;toimintapelin_kansio.png&quot; class=&quot;inline&quot; loading=&quot;lazy&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;561&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;563&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;589&quot;--&gt;Luodaan kansioon Notepad++ -ohjelmalla kolme tiedostoa:&lt;/p&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;592&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;592&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;622&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;594&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;622&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;594&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;606&quot;--&gt;index.html&lt;/code&gt; (pelin rakenne)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;625&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;655&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;627&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;655&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;627&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;638&quot;--&gt;style.css&lt;/code&gt; (pelin ulkonäkö)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;658&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;660&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;660&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;671&quot;--&gt;script.js&lt;/code&gt; (pelin toiminnallisuus)&lt;br/&gt;&#10;&lt;span class=&quot;medium&quot;&gt;&lt;a href=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-tiedostot.png#top&quot; title=&quot;toimintapelin_tiedostot.png&quot;&gt;&lt;img src=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-tiedostot.png:file/photo/a5ba23040df36c8ffdc35ad4327c0a80fccd5f80/toimintapelin_tiedostot.png&quot; alt=&quot;&quot; title=&quot;toimintapelin_tiedostot.png&quot; class=&quot;inline&quot; loading=&quot;lazy&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;561&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;563&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;589&quot;--&gt;Tiedostojen sisällöt kuvataan alla:&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;697&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;714&quot;--&gt;2. Kopio seuraavat koodit näihin tiedostoihin&lt;/h3&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;715&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;748&quot;--&gt;Luo &lt;span class=&quot;editor underline&quot;&gt;pelin rakenne&lt;/span&gt; &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;724&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;736&quot;--&gt;index.html&lt;/code&gt;-tiedostoon:&lt;/p&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-html&quot;&gt;&lt;span&gt;&lt;span class=&quot;hljs-meta&quot;&gt;&amp;lt;!DOCTYPE &lt;span class=&quot;hljs-keyword&quot;&gt;html&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;html&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;lang&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;fi&amp;quot;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;  &amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;  &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;meta&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;charset&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;  &amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;title&lt;/span&gt;&lt;/span&gt;&amp;gt;Mun Toimintapeli&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;title&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;  &amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;link&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;rel&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;href&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;style.css&amp;quot;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;body&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;  &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;canvas&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;gameCanvas&amp;quot;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;800&amp;quot;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;height&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;600&amp;quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;canvas&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;  &amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;script&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;src&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;script.js&amp;quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;script&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;body&lt;/span&gt;&lt;/span&gt;&amp;gt;&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;html&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;br/&gt;&#10;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;whitespace-pre! language-html&quot;&gt;&lt;span&gt;&lt;br/&gt;&#10;&lt;/span&gt;&lt;/code&gt;Tallenna koodi Hyper Text Markup Language File -tyyppisenä:&lt;br/&gt;&#10;&lt;span class=&quot;medium&quot;&gt;&lt;a href=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-index-tiedosto.png#top&quot; title=&quot;toimintapelin_index_tiedosto.png&quot;&gt;&lt;img src=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-index-tiedosto.png:file/photo/7401273bf4c2950a8ae1418a771fea28e726f9bb/toimintapelin_index_tiedosto.png&quot; alt=&quot;&quot; title=&quot;toimintapelin_index_tiedosto.png&quot; class=&quot;inline&quot; loading=&quot;lazy&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;Luo &lt;span class=&quot;editor underline&quot;&gt;pelin ulkonäkö&lt;/span&gt; &lt;code&gt;style.css&lt;/code&gt; -tiedostoon:&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;body {&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  margin: 0;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  height: 100vh;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  background: linear-gradient(135deg, #ff9a9e, #fad0c4, #fad0c4, #fbc2eb, #a18cd1);&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  background-size: 400% 400%;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  animation: gradientMove 15s ease infinite;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;}&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;@keyframes gradientMove {&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  0% {&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;    background-position: 0% 50%;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  }&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  50% {&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;    background-position: 100% 50%;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  }&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  100% {&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;     background-position: 0% 50%;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  }&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;}&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;Tallenna koodi Cascading Style Sheet -tyyppisenä:&lt;br/&gt;&#10;&lt;span class=&quot;medium&quot;&gt;&lt;a href=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-css-tiedosto.png#top&quot; title=&quot;toimintapelin_css_tiedosto.png&quot;&gt;&lt;img src=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-css-tiedosto.png:file/photo/84e9ee2d87aec2d025216aef210a04bd71333993/toimintapelin_css_tiedosto.png&quot; alt=&quot;&quot; title=&quot;toimintapelin_css_tiedosto.png&quot; class=&quot;inline&quot; loading=&quot;lazy&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;h3&gt;3. Aloita toiminnallisuuden kehittäminen ensimmäisestä testikuvasta &lt;/h3&gt;&#10;&lt;br/&gt;&#10;Luo &lt;span class=&quot;editor underline&quot;&gt;pelin toiminnallisuus&lt;/span&gt; &lt;code&gt;script.js&lt;/code&gt; -tiedostoon ja &lt;span&gt;piirrä yksi hahmo (esim. neliö) canvas-elementtiin. Kopio siis seuraava koodi:&lt;/span&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-js&quot;&gt;&lt;span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;let&lt;/span&gt; canvas = &lt;span class=&quot;hljs-variable language_&quot;&gt;document&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;getElementById&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;gameCanvas&amp;quot;&lt;/span&gt;); &lt;br/&gt;&#10;&lt;span class=&quot;hljs-keyword&quot;&gt;let&lt;/span&gt; ctx = canvas.&lt;span class=&quot;hljs-title function_&quot;&gt;getContext&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;2d&amp;quot;&lt;/span&gt;);&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-keyword&quot;&gt;let&lt;/span&gt; player = { &lt;span class=&quot;hljs-attr&quot;&gt;x&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;hljs-attr&quot;&gt;y&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;hljs-attr&quot;&gt;size&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot;&gt;30&lt;/span&gt; };&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;draw&lt;/span&gt;() {&#10;&lt;br/&gt;&#10;  ctx.&lt;span class=&quot;hljs-title function_&quot;&gt;clearRect&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, canvas.&lt;span class=&quot;hljs-property&quot;&gt;width&lt;/span&gt;, canvas.&lt;span class=&quot;hljs-property&quot;&gt;height&lt;/span&gt;);&#10;&lt;br/&gt;&#10;  ctx.&lt;span class=&quot;hljs-property&quot;&gt;fillStyle&lt;/span&gt; = &lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;red&amp;quot;&lt;/span&gt;;&#10;&lt;br/&gt;&#10;  ctx.&lt;span class=&quot;hljs-title function_&quot;&gt;fillRect&lt;/span&gt;(player.&lt;span class=&quot;hljs-property&quot;&gt;x&lt;/span&gt;, player.&lt;span class=&quot;hljs-property&quot;&gt;y&lt;/span&gt;, player.&lt;span class=&quot;hljs-property&quot;&gt;size&lt;/span&gt;, player.&lt;span class=&quot;hljs-property&quot;&gt;size&lt;/span&gt;);&#10;&lt;br/&gt;&#10;}&#10;&lt;br/&gt;&#10;&lt;span class=&quot;hljs-built_in&quot;&gt;setInterval&lt;/span&gt;(draw, &lt;span class=&quot;hljs-number&quot;&gt;30&lt;/span&gt;);&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;Tallenna koodi JavaScript file -tyyppisenä:&lt;br/&gt;&#10;&lt;span class=&quot;medium&quot;&gt;&lt;a href=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-js-tiedosto.png#top&quot; title=&quot;toimintapelin_js_tiedosto.png&quot;&gt;&lt;img src=&quot;https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/24.-syyskuuta-2025/vibe-coding-jatkuu/toimintapelin-js-tiedosto.png:file/photo/64ed51e7262cc605a1f38b3c77dc94118b1f3e20/toimintapelin_js_tiedosto.png&quot; alt=&quot;&quot; title=&quot;toimintapelin_js_tiedosto.png&quot; class=&quot;inline&quot; loading=&quot;lazy&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;4. Liike ja ohjaus&lt;/h3&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1555&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1580&quot;--&gt;Lisää nuolinäppäinohjaus:&lt;/p&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;code&gt;&lt;span class=&quot;hljs-variable language_&quot;&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;hljs-title function_&quot;&gt;addEventListener&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;keydown&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;br/&gt;&#10;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;e&lt;/span&gt;&lt;span&gt;) { &lt;br/&gt;&#10;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;  if&lt;/span&gt;&lt;span&gt; (e.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;key&lt;/span&gt;&lt;span&gt; === &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;ArrowUp&amp;quot;&lt;/span&gt;&lt;span&gt;) player.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;y&lt;/span&gt;&lt;span&gt; -= &lt;/span&gt;&lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;&lt;span&gt;; &lt;br/&gt;&#10;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;  if&lt;/span&gt;&lt;span&gt; (e.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;key&lt;/span&gt;&lt;span&gt; === &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;ArrowDown&amp;quot;&lt;/span&gt;&lt;span&gt;) player.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;y&lt;/span&gt;&lt;span&gt; += &lt;/span&gt;&lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;&lt;span&gt;; &lt;br/&gt;&#10;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;  if&lt;/span&gt;&lt;span&gt; (e.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;key&lt;/span&gt;&lt;span&gt; === &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;ArrowLeft&amp;quot;&lt;/span&gt;&lt;span&gt;) player.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;x&lt;/span&gt;&lt;span&gt; -= &lt;/span&gt;&lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;&lt;span&gt;; &lt;br/&gt;&#10;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;  if&lt;/span&gt;&lt;span&gt; (e.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;key&lt;/span&gt;&lt;span&gt; === &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;ArrowRight&amp;quot;&lt;/span&gt;&lt;span&gt;) player.&lt;/span&gt;&lt;span class=&quot;hljs-property&quot;&gt;x&lt;/span&gt;&lt;span&gt; += &lt;/span&gt;&lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;code&gt;; });&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;/span&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;1826&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1851&quot;--&gt;5. Vibe Coding -vaihe&lt;/h3&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1852&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1882&quot;--&gt;Nyt alkaa ”fiilistelyosuus”:&lt;/p&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;1883&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2140&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1883&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1915&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1885&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1915&quot;--&gt;Muuta värejä, kokoa, nopeutta.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1916&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1978&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1918&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1978&quot;--&gt;Lisää vihollinen (toinen neliö, joka liikkuu satunnaisesti).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1979&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2032&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1981&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2032&quot;--&gt;Tee pistelasku: piste +1 kun osuu tiettyyn kohtaan.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2033&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2078&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2035&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2078&quot;--&gt;Lisää taustaefektejä (esim. muuttuva väri).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2079&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2140&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2081&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2140&quot;--&gt;Kokeile tehdä ääni (vaikka yksinkertainen &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;2123&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2130&quot;--&gt;Audio&lt;/code&gt;-objekti).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;2142&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2165&quot;--&gt;6. Testaa ja iteroi&lt;/h3&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;2166&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2299&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2166&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2193&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2168&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2193&quot;--&gt;Pelaa itse → mikä fiilis?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2194&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2255&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2196&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2255&quot;--&gt;Mitä haluaisit lisää? (Esteitä, vaikeustaso, animaatioita?)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2256&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2299&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2258&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2299&quot;--&gt;Tee yksi muutos kerrallaan → testaa heti.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;2301&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2340&quot;--&gt;7. Bonus (jos aika ja into riittää)&lt;/h3&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;2341&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2465&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2341&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2387&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2343&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2387&quot;--&gt;Lisää aloitusvalikko (”Aloita peli” -nappi).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2388&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2413&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2390&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2413&quot;--&gt;Tee ”Game Over” -ruutu.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2414&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2465&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2416&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2465&quot;--&gt;Tallenna parhaat pisteet selaimen localStorageen.&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;2467&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2470&quot;--&gt;&#10;&lt;h2&gt;&lt;!--filtered attribute: data-start=&quot;2472&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2492&quot;--&gt;🎯 Tärkein asenne&lt;/h2&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;2493&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2693&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2493&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2548&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2495&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2548&quot;--&gt;Ei tarvitse olla täydellistä → tärkeintä on kokeilla!&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2549&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2621&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2551&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2621&quot;--&gt;Vibe coding = &lt;strong&gt;&lt;!--filtered attribute: data-start=&quot;2565&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2620&quot;--&gt;ensin kokeillaan, sitten kehitetään idean ympärille&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;2622&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2693&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;2624&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;2693&quot;--&gt;Kaikki muutokset ovat sallittuja, kunhan itse tykkää lopputuloksesta.&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;b&gt;&lt;strong class=&quot;editor red&quot;&gt;MIKÄLI HALUAT VARMISTAA KOODIEN SÄILYMISEN, KOPIOI NE MYÖS OMAAN PILVEESI (ONEDRIVE)!&lt;/strong&gt;&lt;/b&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</content>
<published>2025-09-23T14:39:34+03:00</published>
</entry>


</feed>