summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2023-05-05 03:16:06 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2023-05-05 03:16:06 -0600
commit70e783628b1bf863da45cc8879b06288a498840b (patch)
tree6a61d3134fbb100f0fc04e9e96782d29e24bb5ed
parentec2aa74d36670d74c153aa0022ab22e79502a061 (diff)
update css, make articles more uniform, add toc and add functionality to scroll to the top
-rwxr-xr-xbs2
-rw-r--r--config.yaml1
-rw-r--r--db/db_art.psv2
-rw-r--r--db/db_blog.psv36
-rw-r--r--live/art/a/elephant_octopus.html7
-rw-r--r--live/art/a/hand_sketches.html9
-rw-r--r--live/art/index.html7
-rw-r--r--live/art/rss.xml2
-rw-r--r--live/art/sitemap.xml2
-rw-r--r--live/art/tag/@black-white.html7
-rw-r--r--live/art/tag/@digital.html7
-rw-r--r--live/art/tag/@drawing.html7
-rw-r--r--live/art/tag/@sketch.html7
-rw-r--r--live/art/tag/@spanish.html7
-rw-r--r--live/blog/a/acomodada_la_pagina_de_arte.html19
-rw-r--r--live/blog/a/asi_nomas_esta_quedando.html19
-rw-r--r--live/blog/a/devs_android_me_trozaron.html15
-rw-r--r--live/blog/a/el_blog_ya_tiene_timestamps.html24
-rw-r--r--live/blog/a/first_blog_post.html23
-rw-r--r--live/blog/a/git_server_with_cgit.html48
-rw-r--r--live/blog/a/hoy_toco_desarrollo_personaje.html13
-rw-r--r--live/blog/a/mail_server_with_postfix.html70
-rw-r--r--live/blog/a/new_blogging_system.html21
-rw-r--r--live/blog/a/password_manager_authenticator_setup.html19
-rw-r--r--live/blog/a/rewrote_pyssg_again.html19
-rw-r--r--live/blog/a/tenia_esto_descuidado.html28
-rw-r--r--live/blog/a/volviendo_a_usar_la_pagina.html21
-rw-r--r--live/blog/a/vpn_server_with_openvpn.html50
-rw-r--r--live/blog/a/website_with_nginx.html49
-rw-r--r--live/blog/a/xmpp_server_with_prosody.html62
-rw-r--r--live/blog/g/flappybird_godot_devlog_1.html312
-rw-r--r--live/blog/g/godot_project_structure.html20
-rw-r--r--live/blog/g/gogodot_jam3_devlog_1.html137
-rw-r--r--live/blog/g/starting_gamedev_blogging.html24
-rw-r--r--live/blog/index.html11
-rw-r--r--live/blog/rss.xml657
-rw-r--r--live/blog/sitemap.xml48
-rw-r--r--live/blog/tag/@code.html122
-rw-r--r--live/blog/tag/@english.html7
-rw-r--r--live/blog/tag/@gamedev.html7
-rw-r--r--live/blog/tag/@gamejam.html7
-rw-r--r--live/blog/tag/@gdscript.html118
-rw-r--r--live/blog/tag/@godot.html9
-rw-r--r--live/blog/tag/@rant.html7
-rw-r--r--live/blog/tag/@server.html7
-rw-r--r--live/blog/tag/@short.html9
-rw-r--r--live/blog/tag/@spanish.html9
-rw-r--r--live/blog/tag/@tools.html7
-rw-r--r--live/blog/tag/@tutorial.html7
-rw-r--r--live/blog/tag/@update.html9
-rw-r--r--live/luevano.xyz/404.html7
-rw-r--r--live/luevano.xyz/contact.html7
-rw-r--r--live/luevano.xyz/donate.html7
-rw-r--r--live/luevano.xyz/index.html7
-rw-r--r--live/static/css/style.css51
-rw-r--r--live/static/css/theme.css37
-rw-r--r--live/static/scripts/return_top.js21
-rw-r--r--plt/base.html7
-rw-r--r--plt/blog/page.html18
-rw-r--r--plt/highlightjs.html1
-rw-r--r--src/art/a/hand_sketches.md2
-rw-r--r--src/blog/a/acomodada_la_pagina_de_arte.md2
-rw-r--r--src/blog/a/asi_nomas_esta_quedando.md4
-rw-r--r--src/blog/a/el_blog_ya_tiene_timestamps.md7
-rw-r--r--src/blog/a/first_blog_post.md6
-rw-r--r--src/blog/a/git_server_with_cgit.md24
-rw-r--r--src/blog/a/mail_server_with_postfix.md45
-rw-r--r--src/blog/a/new_blogging_system.md6
-rw-r--r--src/blog/a/password_manager_authenticator_setup.md2
-rw-r--r--src/blog/a/rewrote_pyssg_again.md4
-rw-r--r--src/blog/a/tenia_esto_descuidado.md8
-rw-r--r--src/blog/a/volviendo_a_usar_la_pagina.md4
-rw-r--r--src/blog/a/vpn_server_with_openvpn.md25
-rw-r--r--src/blog/a/website_with_nginx.md27
-rw-r--r--src/blog/a/xmpp_server_with_prosody.md39
-rw-r--r--src/blog/g/flappybird_godot_devlog_1.md242
-rw-r--r--src/blog/g/godot_project_structure.md1
-rw-r--r--src/blog/g/gogodot_jam3_devlog_1.md93
-rw-r--r--src/blog/g/starting_gamedev_blogging.md7
79 files changed, 1943 insertions, 905 deletions
diff --git a/bs b/bs
index ec625ee..7c1d293 100755
--- a/bs
+++ b/bs
@@ -10,4 +10,4 @@ exit 1
fi
echo "rsync: pushing (U) local (pyssg.xyz) to webserver (luevano.xyz). (pyssg.xyz)"
-rsync -rtuvPL --delete-after --exclude-from=$PYSSG_XYZ_DIR/.rsyncignore $PYSSG_XYZ_DIR/live/ luevanor:/var/www/luevano.xyz/ \ No newline at end of file
+rsync -rtuvPL --delete-after --exclude-from=$PYSSG_XYZ_DIR/.rsyncignore $PYSSG_XYZ_DIR/live/ luevanor:/var/www/luevano.xyz/
diff --git a/config.yaml b/config.yaml
index 3476243..3e7890a 100644
--- a/config.yaml
+++ b/config.yaml
@@ -71,6 +71,7 @@ exts:
pymdvar:
variables:
SURL: "https://static.luevano.xyz"
+ PYSSG_URL: "https://github.com/luevano/pyssg"
enable_env: False
...
---
diff --git a/db/db_art.psv b/db/db_art.psv
index d127482..c8c1d76 100644
--- a/db/db_art.psv
+++ b/db/db_art.psv
@@ -1,2 +1,2 @@
a/elephant_octopus.md|1623005755.256314|0.0|8302ac3b0dd5854a765af354b1cb8d3f|black-white,digital,drawing,spanish
-a/hand_sketches.md|1623426397.9283822|0.0|371402a56b208613c1085e5bd956f90f|black-white,digital,sketch,spanish
+a/hand_sketches.md|1623426397.9283822|1683224957.5241084|4381f4b3eac345d6595e5aae3f8e9057|black-white,digital,sketch,spanish
diff --git a/db/db_blog.psv b/db/db_blog.psv
index 97e81c3..9df622f 100644
--- a/db/db_blog.psv
+++ b/db/db_blog.psv
@@ -1,20 +1,20 @@
-a/website_with_nginx.md|1616122695.085315|1623137232.645304|79fbe75bc61186d4e1776fd02b387832|english,server,tools,tutorial
-a/git_server_with_cgit.md|1616353229.8983006|1623137257.0257351|d0fc18cade23fb42b7e58b8b8e0e22f4|english,server,tools,tutorial
-a/el_blog_ya_tiene_timestamps.md|1615862784.9032707|1621284818.4731243|704abe11709e39c9ec86ca6f8cbe1200|short,spanish,tools,update
-a/first_blog_post.md|1614431313.2090824|1621284833.6700118|ed6ff0b4471a88241798a0aa5b54ddbf|english,short,tools,update
-a/mail_server_with_postfix.md|1616299559.6570284|1623137344.8639452|b589ec8fd628974e11947fadb26ae5c4|english,server,tools,tutorial
-a/new_blogging_system.md|1622172099.117893|1622173322.4337702|b4a00df409794ab3d8e824004c2d486b|english,short,tools,update
-a/asi_nomas_esta_quedando.md|1622795043.0874712|0.0|dcbec925288c5dd8f2bd9a6e70406978|short,spanish,update
-a/acomodada_la_pagina_de_arte.md|1623006369.6071973|1623006525.2665823|50a2280134b5349bfb6d1c517e37a26f|short,spanish,update
-a/xmpp_server_with_prosody.md|1623216270.0372887|1671510819.3465965|4d2ceae4c6a6b4d723fc8a2bf5771462|english,server,tools,tutorial
-a/tenia_esto_descuidado.md|1626594710.918819|0.0|76d45ca201ef36002e0c9c87e7a800e5|short,spanish,update
+a/website_with_nginx.md|1616122695.085315|1683275655.7171004|85936248e56afd9f53ed76e51399a33a|code,english,server,tools,tutorial
+a/git_server_with_cgit.md|1616353229.8983006|1683275738.97709|64f9cfb1385b550b8bf614805594de9a|code,english,server,tools,tutorial
+a/el_blog_ya_tiene_timestamps.md|1615862784.9032707|1683224100.6342998|935866045bf6c35cbb2a4c2fbc2f0eb1|short,spanish,tools,update
+a/first_blog_post.md|1614431313.2090824|1683224048.8343117|d613be2d506a0f7ce03f8fa54f772717|english,short,tools,update
+a/mail_server_with_postfix.md|1616299559.6570284|1683275726.3870916|0ee413182e336947a3cb63715f43523e|code,english,server,tools,tutorial
+a/new_blogging_system.md|1622172099.117893|1683224290.3242564|8370fc65f367886bcfa805cbb8770e01|english,short,tools,update
+a/asi_nomas_esta_quedando.md|1622795043.0874712|1683224323.4442492|a036daaa7940f2567057a775078c418c|short,spanish,update
+a/acomodada_la_pagina_de_arte.md|1623006369.6071973|1683224355.424242|e1aceca92dc98af9e4c3a0b1cec61fb3|short,spanish,update
+a/xmpp_server_with_prosody.md|1623216270.0372887|1683275798.657081|55ae01ca67dde1ff6331d2660c9df69e|code,english,server,tools,tutorial
+a/tenia_esto_descuidado.md|1626594710.918819|1683224450.4442203|801d9caadef53ea30c82c2e8ca5692e6|short,spanish,update
a/hoy_toco_desarrollo_personaje.md|1627452655.5560262|0.0|b891e8efe4e9a5c3f342f9e84e20437a|spanish
-a/vpn_server_with_openvpn.md|1627810022.100739|1627812788.832212|7df7d2d05cb07a5d83284f41f3ce9054|english,server,tools,tutorial
-a/volviendo_a_usar_la_pagina.md|1651116062.9191298|1651116501.5491333|0f36388a5a216a8b7c79a52e84219fca|short,spanish,update
+a/vpn_server_with_openvpn.md|1627810022.100739|1683275819.5970778|e9dfb0d4649057a300a88cdfb2ea3f88|code,english,server,tools,tutorial
+a/volviendo_a_usar_la_pagina.md|1651116062.9191298|1683224582.1841908|0ff1dcfe9edd9ed8f764d3fde061cf35|short,spanish,update
a/devs_android_me_trozaron.md|1652608264.4901433|1652609027.0201497|41c897ac0c6e0bd66f67ddc8286f4413|rant,spanish,update
-a/password_manager_authenticator_setup.md|1652654434.4686146|1653179084.149559|ccd90b7bb896f09438696bb793eb6138|english,short,tools
-g/starting_gamedev_blogging.md|1652764794.9016073|1653179221.26956|2d6665cebea06ff376dbde9643a893c4|english,gamedev,short,update
-g/godot_project_structure.md|1653182170.4395845|1653366918.4756405|a7b153df43631f17864cd8ab67aca60f|english,gamedev,short
-g/flappybird_godot_devlog_1.md|1653795523.5988536|1653795876.8388574|8a4f723fbb20718ad5238fd28aaf28e2|english,gamedev,godot
-g/gogodot_jam3_devlog_1.md|1654852625.58801|0.0|f8767cd4023a7a7c0ccf5388cdef049b|english,gamedev,gamejam,godot
-a/rewrote_pyssg_again.md|1671510665.5266156|0.0|9174dbccf61263045159de182e274af4|english,short,tools,update
+a/password_manager_authenticator_setup.md|1652654434.4686146|1683172189.1237748|ee21642502116ac50d2ef437e69b306c|english,short,tools
+g/starting_gamedev_blogging.md|1652764794.9016073|1683275869.3270695|dad847b856598f6c6eab2f7ec94efac9|english,gamedev,godot,short,update
+g/godot_project_structure.md|1653182170.4395845|1683275847.2870727|8b04f0ba5c8afb92d19c1898f4f9186b|english,gamedev,godot,short
+g/flappybird_godot_devlog_1.md|1653795523.5988536|1683224765.2741501|8c7a5ff4f32dad0887ce70c2d2f58ac8|english,gamedev,gdscript,godot
+g/gogodot_jam3_devlog_1.md|1654852625.58801|1683219939.7152278|89b18f87b523d721bdf8b7fd752e47a6|english,gamedev,gamejam,gdscript,godot
+a/rewrote_pyssg_again.md|1671510665.5266156|1683172648.173672|924824d40b90ab85a091316d788d9e35|english,short,tools,update
diff --git a/live/art/a/elephant_octopus.html b/live/art/a/elephant_octopus.html
index 9d5507a..6da9ded 100644
--- a/live/art/a/elephant_octopus.html
+++ b/live/art/a/elephant_octopus.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Elephant octopus -- Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Elephant octopus</h1>
<a class="zoom-in" href="https://static.luevano.xyz/images/a/elephant_octopus.png" alt="See raw.">
diff --git a/live/art/a/hand_sketches.html b/live/art/a/hand_sketches.html
index dd1927b..9cb7186 100644
--- a/live/art/a/hand_sketches.html
+++ b/live/art/a/hand_sketches.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Hand sketches -- Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Hand sketches</h1>
<a class="zoom-in" href="https://static.luevano.xyz/images/a/hand_sketches.png" alt="See raw.">
@@ -74,7 +81,7 @@
<p>Me dibujé la mano varias veces con un pincel que me encontré de Krita muy bueno, porque quiero ir soltando, vaya, la mano, para dibujar más agusto porque siento que le tengo mucho miedo a la tableta.</p>
<p>Según yo probé &ldquo;métodos&rdquo; (y como dos-tres pinceles) diferentes, pero realmente están muy similares en &ldquo;procedimiento&rdquo;. Igual quedé conforme con el resultado.</p>
-<p>Ahora con el anuncio del ???Elden Ring??? se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.</p>
+<p>Ahora con el anuncio del <mark>Elden Ring</mark> se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.</p>
<p>Pues ahí mero. Y por cierto que muchas gracias a quien me donó hace unos días por el dibujo pasado, se aprecia mi bro.</p>
<div class="art-nav">
diff --git a/live/art/index.html b/live/art/index.html
index 5ede7e3..2e95bcb 100644
--- a/live/art/index.html
+++ b/live/art/index.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Index -- Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Index -- Luevano's Art</h1>
<p>Here is where I will post all of my drawings, sketches and more art related stuff. Right now this is managed similar to the <a href="https://blog.luevano.xyz" alt="Luévano's Blog">blog</a>, but more "gallery" oriented. The structure is kind of a 3-level zoom, where you see all the images in this index (or on a tag index), then you see the whole image in its separate link with additional information and then you can see the raw image itself.</p>
diff --git a/live/art/rss.xml b/live/art/rss.xml
index 7d014d7..65c5268 100644
--- a/live/art/rss.xml
+++ b/live/art/rss.xml
@@ -34,7 +34,7 @@
<description>Sketches de mi mano para ir agarrando confianza con la tableta. Probando diferentes métodos/pinceles.</description>
<content:encoded><![CDATA[<p>Me dibujé la mano varias veces con un pincel que me encontré de Krita muy bueno, porque quiero ir soltando, vaya, la mano, para dibujar más agusto porque siento que le tengo mucho miedo a la tableta.</p>
<p>Según yo probé &ldquo;métodos&rdquo; (y como dos-tres pinceles) diferentes, pero realmente están muy similares en &ldquo;procedimiento&rdquo;. Igual quedé conforme con el resultado.</p>
-<p>Ahora con el anuncio del ???Elden Ring??? se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.</p>
+<p>Ahora con el anuncio del <mark>Elden Ring</mark> se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.</p>
<p>Pues ahí mero. Y por cierto que muchas gracias a quien me donó hace unos días por el dibujo pasado, se aprecia mi bro.</p>]]></content:encoded>
</item>
<item>
diff --git a/live/art/sitemap.xml b/live/art/sitemap.xml
index b20aab6..3eee2e7 100644
--- a/live/art/sitemap.xml
+++ b/live/art/sitemap.xml
@@ -47,7 +47,7 @@
<url>
<loc>https://art.luevano.xyz/a/hand_sketches.html</loc>
- <lastmod>2021-06-11</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
diff --git a/live/art/tag/@black-white.html b/live/art/tag/@black-white.html
index 484f5ea..56c72b1 100644
--- a/live/art/tag/@black-white.html
+++ b/live/art/tag/@black-white.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Art filtered by black-white</h1>
<div class="art-grid">
diff --git a/live/art/tag/@digital.html b/live/art/tag/@digital.html
index ba93c86..f823b22 100644
--- a/live/art/tag/@digital.html
+++ b/live/art/tag/@digital.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Art filtered by digital</h1>
<div class="art-grid">
diff --git a/live/art/tag/@drawing.html b/live/art/tag/@drawing.html
index 5a00975..dcbc96b 100644
--- a/live/art/tag/@drawing.html
+++ b/live/art/tag/@drawing.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Art filtered by drawing</h1>
<div class="art-grid">
diff --git a/live/art/tag/@sketch.html b/live/art/tag/@sketch.html
index 5b42db8..54d5676 100644
--- a/live/art/tag/@sketch.html
+++ b/live/art/tag/@sketch.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Art filtered by sketch</h1>
<div class="art-grid">
diff --git a/live/art/tag/@spanish.html b/live/art/tag/@spanish.html
index be039a2..c3583ec 100644
--- a/live/art/tag/@spanish.html
+++ b/live/art/tag/@spanish.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Art"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Art filtered by spanish</h1>
<div class="art-grid">
diff --git a/live/blog/a/acomodada_la_pagina_de_arte.html b/live/blog/a/acomodada_la_pagina_de_arte.html
index bfd6cce..5703a47 100644
--- a/live/blog/a/acomodada_la_pagina_de_arte.html
+++ b/live/blog/a/acomodada_la_pagina_de_arte.html
@@ -16,13 +16,11 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
<meta property="og:title" content="Al fin ya me acomodé la página pa' los dibujos -- Luevano's Blog"/>
@@ -73,10 +71,15 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Al fin ya me acomodé la página pa' los dibujos</h1>
<p>Así es, ya quedó acomodado el sub-dominio <code>art.luevano.xyz</code> pos pal <a href="https://art.luevano.xyz">arte</a> veda. Entonces pues ando feliz por eso.</p>
-<p>Este pedo fue gracias a que me reescribí la forma en la que <code>pyssg</code> maneja los templates, ahora uso el sistema de <code>jinja</code> en vez del cochinero que hacía antes.</p>
+<p>Este pedo fue gracias a que me reescribí la forma en la que <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> maneja los templates, ahora uso el sistema de <a href="https://jinja.palletsprojects.com/en/3.1.x/"><code>jinja</code></a> en vez del cochinero que hacía antes.</p>
<p>Y pues nada más eso, aquí está el <a href="https://art.luevano.xyz/a/elephant_octopus.html">primer post</a> y por supuesto acá está el link del RSS <a href="https://art.luevano.xyz/rss.xml">https://art.luevano.xyz/rss.xml</a>.</p>
<div class="page-nav">
@@ -107,7 +110,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, Jun 06, 2021 @ 19:06 UTC</p>
- <p>Modified: Sun, Jun 06, 2021 @ 19:08 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:19 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/asi_nomas_esta_quedando.html b/live/blog/a/asi_nomas_esta_quedando.html
index c1f9f3f..b275a2c 100644
--- a/live/blog/a/asi_nomas_esta_quedando.html
+++ b/live/blog/a/asi_nomas_esta_quedando.html
@@ -16,13 +16,11 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
<meta property="og:title" content="Así nomás está quedando el página -- Luevano's Blog"/>
@@ -73,13 +71,19 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Así nomás está quedando el página</h1>
<p>Estuve acomodando un poco más el <em>sItIo</em>, al fin agregué la &ldquo;sección&rdquo; de <a href="https://luevano.xyz/contact.html">contact</a> y de <a href="https://luevano.xyz/donate.html">donate</a> por si hay algún loco que quiere tirar varo.</p>
<p>También me puse a acomodar un servidor de <a href="https://xmpp.org/">XMPP</a> el cual, en pocas palabras, es un protocolo de mensajería instantánea (y más) descentralizado, por lo cual cada quien puede hacer una cuenta en el servidor que quiera y conectarse con cuentas creadas en otro servidor&hellip; exacto, como con los correos electrónicos. Y esto está perro porque si tú tienes tu propio server, así como con uno de correo electrónico, puedes controlar qué características tiene, quiénes pueden hacer cuenta, si hay <em>end-to-end encryption</em> (o mínimo <em>end-to-server</em>), entre un montón de otras cosas.</p>
<p>Ahorita este server es SUMISO (<em>compliant</em> en español, jeje) para jalar con la app <a href="https://conversations.im/">conversations</a> y con la red social <a href="https://movim.eu/">movim</a>, pero realmente funcionaría con casi cualquier cliente de XMPP, amenos que ese cliente implemente algo que no tiene mi server. Y también acomodé un server de <a href="https://matrix.org/">Matrix</a> que es muy similar pero es bajo otro protocolo y se siente más como un discord/slack (al menos en el <a href="https://element.io/">element</a>), muy chingón también.</p>
-<p>Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el <a href="https://github.com/luevano/pyssg">pyssg</a> para que jale chido para este pex.</p>
+<p>Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> para que jale chido para este pex.</p>
<p>Ya por último también quiero moverle un poco al CSS, porque lo dejé en un estado muy culerón y quiero meterle/ajustar unas cosas para que quede más limpio y medianamente bonito&hellip; <em>dentro de lo que cabe porque evidentemente me vale verga si se ve como una página del 2000</em>.</p>
+<p><strong>Actualización</strong>: Ya tumbé el servidor de XMPP porque consumía bastantes recursos y no lo usaba tanto, si en un futuro consigo un mejor servidor podría volver a hostearlo.</p>
<div class="page-nav">
<span class="next">
@@ -109,6 +113,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Fri, Jun 04, 2021 @ 08:24 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:18 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/devs_android_me_trozaron.html b/live/blog/a/devs_android_me_trozaron.html
index 69239fb..860bd63 100644
--- a/live/blog/a/devs_android_me_trozaron.html
+++ b/live/blog/a/devs_android_me_trozaron.html
@@ -16,13 +16,11 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
<meta property="og:title" content="Los devs de Android/MIUI me trozaron -- Luevano's Blog"/>
@@ -73,6 +71,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Los devs de Android/MIUI me trozaron</h1>
<p>Llevo dos semanas posponiendo esta entrada porque andaba bien enojado (todavía, pero ya se anda pasando) y me daba <em>zzz</em>. Pero bueno, antes que nada este pex ocupa un poco de contexto sobre dos cositas:</p>
diff --git a/live/blog/a/el_blog_ya_tiene_timestamps.html b/live/blog/a/el_blog_ya_tiene_timestamps.html
index 29c080e..cf9d36d 100644
--- a/live/blog/a/el_blog_ya_tiene_timestamps.html
+++ b/live/blog/a/el_blog_ya_tiene_timestamps.html
@@ -16,13 +16,12 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
<!-- og meta -->
<meta property="og:title" content="Así es raza, el blog ya tiene timestamps -- Luevano's Blog"/>
@@ -73,12 +72,19 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Así es raza, el blog ya tiene timestamps</h1>
<p>Pues eso, esta entrada es sólo para tirar update sobre mi <a href="https://blog.luevano.xyz/a/first_blog_post.html">primer post</a>. Ya modifiqué el <code>ssg</code> lo suficiente como para que maneje los <em>timestamps</em>, y ya estoy más familiarizado con este script entonces ya lo podré extender más, pero por ahora las entradas ya tienen su fecha de creación (y modificación en dado caso) al final y en el índice ya están organizados por fecha, que por ahora está algo simple pero está sencillo de extender.</p>
<p>Ya lo único que queda es cambiar un poco el formato del blog (y de la página en general), porque en un momento de desesperación puse todo el texto en justificado y pues no se ve chido siempre, entonces queda corregir eso. <em>Y aunque me tomó más tiempo del que quisiera, así nomás quedó, diría un cierto personaje.</em></p>
-<p>El <code>ssg</code> modificado está en mis <a href="https://git.luevano.xyz/.dots">dotfiles</a> (o directamente <a href="https://git.luevano.xyz/.dots/tree/.local/bin/ssg">aquí</a>).</p>
-<p>Por último, también quité las extensiones <code>.html</code> de las URLs, porque se veía bien pitero, pero igual los links con <code>.html</code> al final redirigen a su link sin <code>.html</code>, así que no hay rollo alguno.</p>
+<p><del>El <code>ssg</code> modificado está en mis <a href="https://git.luevano.xyz/.dots">dotfiles</a> (o directamente <a href="https://git.luevano.xyz/.dots/tree/.local/bin/ssg">aquí</a>).</del>
+<ins>Como al final ya no usé el <code>ssg</code> modificado, este pex ya no existe.</ins></p>
+<p>Por último, también quité las extensiones <code>.html</code> de las URLs, porque se ve bien pitero, pero igual los links con <code>.html</code> al final redirigen a su link sin <code>.html</code>, así que no hay rollo alguno.</p>
+<p><strong>Actualización</strong>: Ahora estoy usando mi propia solución en vez de <code>ssg</code>, que la llamé <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, de la cual empiezo a hablar <a href="https://blog.luevano.xyz/a/new_blogging_system.html">acá</a>.</p>
<div class="page-nav">
<span class="next">
@@ -108,7 +114,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Tue, Mar 16, 2021 @ 02:46 UTC</p>
- <p>Modified: Mon, May 17, 2021 @ 20:53 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:15 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/first_blog_post.html b/live/blog/a/first_blog_post.html
index 6da8afd..d5eb3fd 100644
--- a/live/blog/a/first_blog_post.html
+++ b/live/blog/a/first_blog_post.html
@@ -16,13 +16,12 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
<!-- og meta -->
<meta property="og:title" content="This is the first blog post, just for testing purposes -- Luevano's Blog"/>
@@ -73,11 +72,17 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>This is the first blog post, just for testing purposes</h1>
- <p>I&rsquo;m making this post just to figure out how <a href="https://www.romanzolotarev.com/ssg.html"><code>ssg5</code></a> and <a href="https://kristaps.bsd.lv/lowdown/"><code>lowdown</code></a> are supposed to work (and eventually also <a href="https://www.romanzolotarev.com/rssg.html"><code>rssg</code></a>).</p>
-<p>At the moment, I&rsquo;m not satisfied because there&rsquo;s no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the <a href="https://blog.luevano.xyz/">blog homepage</a> (and there&rsquo;s also the problem with the ordering of the entries&hellip;). And all of this just because I didn&rsquo;t want to use <a href="https://github.com/LukeSmithxyz/lb">Luke&rsquo;s</a> solution (don&rsquo;t really like that much how he handles the scripts&hellip; <em>but they just work</em>).</p>
+ <p>I&rsquo;m making this post just to figure out how <a href="https://www.romanzolotarev.com/ssg.html"><code>ssg5</code></a> and <a href="https://kristaps.bsd.lv/lowdown/"><code>lowdown</code></a> are supposed to work, and eventually <a href="https://www.romanzolotarev.com/rssg.html"><code>rssg</code></a>.</p>
+<p>At the moment I&rsquo;m not satisfied because there&rsquo;s no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the <a href="https://blog.luevano.xyz/">blog homepage</a> which also has a problem with the ordering of the entries. And all of this just because I didn&rsquo;t want to use Luke&rsquo;s <a href="https://github.com/LukeSmithxyz/lb">lb</a> solution as I don&rsquo;t really like that much how he handles the scripts (<em>but they just work</em>).</p>
<p>Hopefully, for tomorrow all of this will be sorted out and I&rsquo;ll have a working blog system.</p>
+<p><strong>Update</strong>: I&rsquo;m now using my own solution which I called <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, of which I talk about <a href="https://blog.luevano.xyz/a/new_blogging_system.html">here</a>.</p>
<div class="page-nav">
<span class="next">
@@ -101,7 +106,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sat, Feb 27, 2021 @ 13:08 UTC</p>
- <p>Modified: Mon, May 17, 2021 @ 20:53 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:14 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/git_server_with_cgit.html b/live/blog/a/git_server_with_cgit.html
index defcf3e..3c0bcae 100644
--- a/live/blog/a/git_server_with_cgit.html
+++ b/live/blog/a/git_server_with_cgit.html
@@ -16,14 +16,21 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Create a git server and setup cgit web app (on Nginx) -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,17 +80,34 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Create a git server and setup cgit web app (on Nginx)</h1>
- <p>My git server is all I need to setup to actually <em>kill</em> my other server (I&rsquo;ve been moving from servers on these last 2-3 blog entries), that&rsquo;s why I&rsquo;m already doing this entry. I&rsquo;m basically following <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server">git&rsquo;s guide on setting up a server</a> plus some specific stuff for (btw i use) Arch Linux (<a href="https://wiki.archlinux.org/index.php/Git_server#Web_interfaces">Arch Linux Wiki: Git server</a> and <a href="https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/">Step by step guide on setting up git server in arch linux (pushable)</a>).</p>
-<p>Note that this is mostly for personal use, so there&rsquo;s no user/authentication control other than that of SSH. Also, most if not all commands here are run as root.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <p>My git server is all I need to setup to actually <em>kill</em> my other server (I&rsquo;ve been moving from servers on these last 2-3 blog entries), that&rsquo;s why I&rsquo;m already doing this entry. I&rsquo;m basically following <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server">git&rsquo;s guide on setting up a server</a> plus some specific stuff for <mark>btw i use</mark> Arch Linux (<a href="https://wiki.archlinux.org/index.php/Git_server#Web_interfaces">Arch Linux Wiki: Git server</a> and <a href="https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/">Step by step guide on setting up git server in arch linux (pushable)</a>).</p>
+<p>Note that this is mostly for personal use, so there&rsquo;s no user/authentication control other than that of normal <code>ssh</code>. And as with the other entries, most if not all commands here are run as root unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#git">Git</a></li>
+<li><a href="#cgit">Cgit</a><ul>
+<li><a href="#cgits-file-rendering">Cgit&rsquo;s file rendering</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>I might get tired of saying this (it&rsquo;s just copy paste, basically)&hellip; but you will need the same prerequisites as before (check my <a href="https://blog.luevano.xyz/a/website_with_nginx.html">website</a> and <a href="https://blog.luevano.xyz/a/mail_server_with_postfix.html">mail</a> entries), with the extras:</p>
<ul>
<li>(Optional, if you want a &ldquo;front-end&rdquo;) A <strong>CNAME</strong> for &ldquo;git&rdquo; and (optionally) &ldquo;www.git&rdquo;, or some other name for your sub-domains.</li>
<li>An SSL certificate, if you&rsquo;re following the other entries, add a <code>git.conf</code> and run <code>certbot --nginx</code> to extend the certificate.</li>
</ul>
-<h3 id="git">Git<a class="headerlink" href="#git" title="Permanent link">&para;</a></h3>
+<h2 id="git">Git<a class="headerlink" href="#git" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/git">Git</a> is a version control system.</p>
<p>If not installed already, install the <code>git</code> package:</p>
<pre><code class="language-sh">pacman -S git
@@ -117,11 +141,11 @@ systemctl enable git-daemon.socket
</code></pre>
<p>You&rsquo;re basically done. Now you should be able to push/pull repositories to your server&hellip; except, you haven&rsquo;t created any repository in your server, that&rsquo;s right, they&rsquo;re not created automatically when trying to push. To do so, you have to run (while inside <code>/home/git</code>):</p>
<pre><code class="language-sh">git init --bare {repo_name}.git
-chown -R git:git repo_name.git
+chown -R git:git {repo_name}.git
</code></pre>
-<p>Those two lines above will need to be run each time you want to add a new repository to your server (yeah, kinda lame&hellip; although there are options to &ldquo;automate&rdquo; this, I like it this way).</p>
+<p><mark>Those two lines above will need to be run each time you want to add a new repository to your server</mark>. There are options to &ldquo;automate&rdquo; this but I like it this way.</p>
<p>After that you can already push/pull to your repository. I have my repositories (locally) set up so I can push to more than one remote at the same time (my server, GitHub, GitLab, etc.); to do so, check <a href="https://gist.github.com/rvl/c3f156e117e22a25f242">this gist</a>.</p>
-<h3 id="cgit">Cgit<a class="headerlink" href="#cgit" title="Permanent link">&para;</a></h3>
+<h2 id="cgit">Cgit<a class="headerlink" href="#cgit" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Cgit">Cgit</a> is a fast web interface for git.</p>
<p>This is optionally since it&rsquo;s only for the web application.</p>
<p>Install the <code>cgit</code> and <code>fcgiwrap</code> packages:</p>
@@ -162,10 +186,9 @@ repo.url={url}
repo.path={dir_path}
repo.owner={owner}
repo.desc={short_description}
-
...
</code></pre>
-<p>Where you can uncomment the <code>robots</code> line to let web crawlers (like Google&rsquo;s) to index your <code>git</code> web app. And at the end keep all your repositories (the ones you want to make public), for example for my <a href="https://git.luevano.xyz/.dots"><em>dotfiles</em></a> I have:</p>
+<p>Where you can uncomment the <code>robots</code> line to not let web crawlers (like Google&rsquo;s) to index your <code>git</code> web app. And at the end keep all your repositories (the ones you want to make public), for example for my <a href="https://git.luevano.xyz/.dots"><em>dotfiles</em></a> I have:</p>
<pre><code class="language-apache">...
repo.url=.dots
repo.path=/home/git/.dots.git
@@ -174,6 +197,7 @@ repo.desc=These are my personal dotfiles.
...
</code></pre>
<p>Otherwise you could let <code>cgit</code> to automatically detect your repositories (you have to be careful if you want to keep &ldquo;private&rdquo; repos) using the option <code>scan-path</code> and setup <code>.git/description</code> for each repository. For more, you can check <a href="https://man.archlinux.org/man/cgitrc.5">cgitrc(5)</a>.</p>
+<h3 id="cgits-file-rendering">Cgit&rsquo;s file rendering<a class="headerlink" href="#cgits-file-rendering" title="Permanent link">&para;</a></h3>
<p>By default you can&rsquo;t see the files on the site, you need a highlighter to render the files, I use <code>highlight</code>. Install the <code>highlight</code> package:</p>
<pre><code class="language-sh">pacman -S highlight
</code></pre>
@@ -222,10 +246,10 @@ exec highlight --force --inline-css -f -I -O xhtml -S &quot;$EXTENSION&quot; 2&g
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, Mar 21, 2021 @ 19:00 UTC</p>
- <p>Modified: Tue, Jun 08, 2021 @ 07:27 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:35 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
</div>
</div>
diff --git a/live/blog/a/hoy_toco_desarrollo_personaje.html b/live/blog/a/hoy_toco_desarrollo_personaje.html
index e67976a..e57dd46 100644
--- a/live/blog/a/hoy_toco_desarrollo_personaje.html
+++ b/live/blog/a/hoy_toco_desarrollo_personaje.html
@@ -16,13 +16,9 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
<!-- og meta -->
<meta property="og:title" content="Hoy me tocó desarrollo de personaje -- Luevano's Blog"/>
@@ -73,6 +69,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Hoy me tocó desarrollo de personaje</h1>
<p>Sabía que hoy no iba a ser un día tan bueno, pero no sabía que iba a estar tan horrible; me tocó desarrollo de personaje y saqué el <em>bad ending</em>.</p>
diff --git a/live/blog/a/mail_server_with_postfix.html b/live/blog/a/mail_server_with_postfix.html
index c8acc43..95003e5 100644
--- a/live/blog/a/mail_server_with_postfix.html
+++ b/live/blog/a/mail_server_with_postfix.html
@@ -16,14 +16,21 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Create a mail server with Postfix, Dovecot, SpamAssassin and OpenDKIM -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,18 +80,38 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Create a mail server with Postfix, Dovecot, SpamAssassin and OpenDKIM</h1>
- <p>The entry is going to be long because it&rsquo;s a <em>tedious</em> process. This is also based on <a href="https://github.com/LukeSmithxyz/emailwiz">Luke Smith&rsquo;s script</a>, but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I&rsquo;m in the process of installing/configuring the mail server on a new VPS of mine; also I&rsquo;m going to be writing a script that does everything in one go (for Arch Linux), that will be hosted <a href="https://git.luevano.xyz/server_scripts.git">here</a>.</p>
-<p>This configuration works for local users (users that appear in <code>/etc/passwd</code>), and does not use any type of SQL Database. And note that most if not all commands executed here are run with root privileges.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <p>The entry is going to be long because it&rsquo;s a <em>tedious</em> process. This is also based on <a href="https://github.com/LukeSmithxyz/emailwiz">Luke Smith&rsquo;s script</a>, but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I&rsquo;m in the process of installing/configuring the mail server on a new VPS of mine; <del>also I&rsquo;m going to be writing a script that does everything in one go (for Arch Linux), that will be hosted <a href="https://git.luevano.xyz/server_scripts.git">here</a>.</del> <ins>I haven&rsquo;t had time to do the script so nevermind this, if I ever do it I&rsquo;ll make a new entry regarding it.</ins></p>
+<p>This configuration works for local users (users that appear in <code>/etc/passwd</code>), and does not use any type of SQL database. And note that most if not all commands executed here are run with root privileges, unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#postfix">Postfix</a></li>
+<li><a href="#dovecot">Dovecot</a></li>
+<li><a href="#opendkim">OpenDKIM</a><ul>
+<li><a href="#opendkim-dns-txt-records">OpenDKIM DNS TXT records</a></li>
+</ul>
+</li>
+<li><a href="#spamassassin">SpamAssassin</a></li>
+<li><a href="#wrapping-up">Wrapping up</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Basically the same as with the <a href="https://blog.luevano.xyz/a/website_with_nginx.html">website with Nginx and Certbot</a>, with the extras:</p>
<ul>
<li>You will need a <strong>CNAME</strong> for &ldquo;mail&rdquo; and (optionally) &ldquo;www.mail&rdquo;, or whatever you want to call the sub-domains (although the <a href="https://tools.ietf.org/html/rfc2181#section-10.3">RFC 2181</a> states that it NEEDS to be an <strong>A</strong> record, fuck the police).</li>
<li>An SSL certificate. You can use the SSL certificate obtained following my last post using <code>certbot</code> (just create a <code>mail.conf</code> and run <code>certbot --nginx</code> again).</li>
-<li>Ports 25, 587 (SMTP), 465 (SMTPS), 143 (IMAP) and 993 (IMAPS) open on the firewall.</li>
+<li>Ports <code>25</code>, <code>587</code> (SMTP), <code>465</code> (SMTPS), <code>143</code> (IMAP) and <code>993</code> (IMAPS) open on the firewall (I use <code>ufw</code>).</li>
</ul>
-<h3 id="postfix">Postfix<a class="headerlink" href="#postfix" title="Permanent link">&para;</a></h3>
+<h2 id="postfix">Postfix<a class="headerlink" href="#postfix" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/postfix">Postfix</a> is a &ldquo;mail transfer agent&rdquo; which is the component of the mail server that receives and sends emails via SMTP.</p>
<p>Install the <code>postfix</code> package:</p>
<pre><code class="language-sh">pacman -S postfix
@@ -121,7 +148,7 @@ smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
</code></pre>
-<p>Specify the mailbox home (this is going to be a directory inside your user&rsquo;s home containing the actual mail files):</p>
+<p>Specify the mailbox home, this is going to be a directory inside your user&rsquo;s home containing the actual mail files, for example it will end up being<code>/home/david/Mail/Inbox</code>:</p>
<pre><code class="language-apache">home_mailbox = Mail/Inbox/
</code></pre>
<p>Pre-configuration to work seamlessly with <code>dovecot</code> and <code>opendkim</code>:</p>
@@ -135,8 +162,7 @@ smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = inet:127.0.0.1:8891
mailbox_command = /usr/lib/dovecot/deliver
</code></pre>
-<p>Where <code>{yourdomainname}</code> is <code>luevano.xyz</code> in my case, or if you have <code>localhost</code> configured to your domain, then use <code>localhost</code> for <code>myhostname</code> (<code>myhostname = localhost</code>).</p>
-<p>Lastly, if you don&rsquo;t want the sender&rsquo;s IP and user agent (application used to send the mail), add the following line:</p>
+<p>Where <code>{yourdomainname}</code> is <code>luevano.xyz</code> in my case. Lastly, if you don&rsquo;t want the sender&rsquo;s IP and user agent (application used to send the mail), add the following line:</p>
<pre><code class="language-apache">smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
</code></pre>
<p>And create the <code>/etc/postfix/smtp_header_checks</code> file with the following content:</p>
@@ -173,7 +199,7 @@ newaliases
<pre><code class="language-sh">systemctl start postfix.service
systemctl enable postfix.service
</code></pre>
-<h3 id="dovecot">Dovecot<a class="headerlink" href="#dovecot" title="Permanent link">&para;</a></h3>
+<h2 id="dovecot">Dovecot<a class="headerlink" href="#dovecot" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Dovecot">Dovecot</a> is an IMAP and POP3 server, which is what lets an email application retrieve the mail.</p>
<p>Install the <code>dovecot</code> and <code>pigeonhole</code> (sieve for <code>dovecot</code>) packages:</p>
<pre><code class="language-sh">pacman -S dovecot pigeonhole
@@ -288,8 +314,8 @@ account required pam_unix.so
<pre><code class="language-sh">systemctl start dovecot.service
systemctl enable dovecot.service
</code></pre>
-<h3 id="opendkim">OpenDKIM<a class="headerlink" href="#opendkim" title="Permanent link">&para;</a></h3>
-<p><a href="https://wiki.archlinux.org/title/OpenDKIM">OpenDKIM</a> is needed so services like G**gle (we don&rsquo;t mention that name here [[[this is a meme]]]) don&rsquo;t throw the mail to the trash. DKIM stands for &ldquo;DomainKeys Identified Mail&rdquo;.</p>
+<h2 id="opendkim">OpenDKIM<a class="headerlink" href="#opendkim" title="Permanent link">&para;</a></h2>
+<p><a href="https://wiki.archlinux.org/title/OpenDKIM">OpenDKIM</a> is needed so services like G**gle don&rsquo;t throw the mail to the trash. DKIM stands for &ldquo;DomainKeys Identified Mail&rdquo;.</p>
<p>Install the <code>opendkim</code> package:</p>
<pre><code class="language-sh">pacman -S opendkim
</code></pre>
@@ -338,7 +364,8 @@ chmod g+r /etc/postfix/dkim/*
<pre><code class="language-sh">systemctl start opendkim.service
systemctl enable opendkim.service
</code></pre>
-<p>And don&rsquo;t forget to add the following <strong>TXT</strong> records on your domain registrar (these examples are for Epik):</p>
+<h3 id="opendkim-dns-txt-records">OpenDKIM DNS TXT records<a class="headerlink" href="#opendkim-dns-txt-records" title="Permanent link">&para;</a></h3>
+<p>Add the following <strong>TXT</strong> records on your domain registrar (these examples are for Epik):</p>
<ol>
<li><em>DKIM</em> entry: look up your <code>{yoursubdomain}.txt</code> file, it should look something like:</li>
</ol>
@@ -346,7 +373,7 @@ systemctl enable opendkim.service
&quot;p=...&quot;
&quot;...&quot; ) ; ----- DKIM key mail for {yourdomain}
</code></pre>
-<p>In the TXT record you will place <code>{yoursubdomain}._domainkey</code> as the &ldquo;Host&rdquo; and <code>"v=DKIM1; k=rsa; s=email; " "p=..." "..."</code> in the &ldquo;TXT Value&rdquo; (replace the dots with the actual value you see in your file).</p>
+<p>In the <strong>TXT</strong> record you will place <code>{yoursubdomain}._domainkey</code> as the &ldquo;Host&rdquo; and <code>"v=DKIM1; k=rsa; s=email; " "p=..." "..."</code> in the &ldquo;TXT Value&rdquo; (replace the dots with the actual value you see in your file).</p>
<ol start="2">
<li>
<p><em>DMARC</em> entry: just <code>_dmarc.{yourdomain}</code> as the &ldquo;Host&rdquo; and <code>"v=DMARC1; p=reject; rua=mailto:dmarc@{yourdomain}; fo=1"</code> as the &ldquo;TXT Value&rdquo;.</p>
@@ -356,7 +383,7 @@ systemctl enable opendkim.service
</li>
</ol>
<p>And at this point you could test your mail for spoofing and more.</p>
-<h3 id="spamassassin">SpamAssassin<a class="headerlink" href="#spamassassin" title="Permanent link">&para;</a></h3>
+<h2 id="spamassassin">SpamAssassin<a class="headerlink" href="#spamassassin" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/SpamAssassin">SpamAssassin</a> is just <em>a mail filter to identify spam</em>.</p>
<p>Install the <code>spamassassin</code> package (which will install a bunch of ugly <code>perl</code> packages&hellip;):</p>
<pre><code class="language-sh">pacman -S spamassassin
@@ -409,10 +436,10 @@ ExecStart=/usr/bin/vendor_perl/spamd -x -u spamd -g spamd --listen=/run/spamd/sp
<pre><code class="language-sh">systemctl start spamassassin.service
systemctl enable spamassassin.service
</code></pre>
-<h3 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h3>
-<p>We should have a working mail server by now. Before continuing check your journal logs (<code>journalctl -xe --unit={unit}</code>, where <code>{unit}</code> could be <code>spamassassin.service</code> for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere (the logs are generally really descriptive) because all the settings and steps detailed here just (literally just finished doing everything on a new server as of the writing of this text) worked <em>(((it just werks on my machine)))</em>.</p>
+<h2 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h2>
+<p>We should have a working mail server by now. Before continuing check your journal logs (<code>journalctl -xe --unit={unit}</code>, where <code>{unit}</code> could be <code>spamassassin.service</code> for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere because all the settings and steps detailed here just worked; I literally just finished doing everything on a new server as of the writing of this text, <mark>it just werks on my machine</mark>.</p>
<p>Now, to actually use the mail service: first of all, you need a <em>normal</em> account (don&rsquo;t use root) that belongs to the <code>mail</code> group (<code>gpasswd -a user group</code> to add a user <code>user</code> to group <code>group</code>) and that has a password.</p>
-<p>Next, to actually login into a mail app/program/whateveryouwanttocallit, you will use the following settings, at least for <code>thunderdbird</code>(I tested in windows default mail app and you don&rsquo;t need a lot of settings):</p>
+<p>Next, to actually login into a mail app/program, you will use the following settings, at least for <code>thunderdbird</code>(I tested in windows default mail app and you don&rsquo;t need a lot of settings):</p>
<ul>
<li>* server: subdomain.domain (mail.luevano.xyz in my case)</li>
<li><strong>SMTP</strong> port: 587</li>
@@ -426,10 +453,9 @@ systemctl enable spamassassin.service
</ul>
<p>All that&rsquo;s left to do is test your mail server for spoofing, and to see if everything is setup correctly. Go to <a href="https://www.appmaildev.com/en/dkim">DKIM Test</a> and follow the instructions (basically click next, and send an email with whatever content to the email that they provide). After you send the email, you should see something like:</p>
<figure id="__yafg-figure-3">
-<img alt="DKIM Test successful" src="images/b/notes/mail/dkim_test_successful.png" title="DKIM Test successful">
+<img alt="DKIM Test successful" src="https://static.luevano.xyz/images/b/notes/mail/dkim_test_successful.png" title="DKIM Test successful">
<figcaption>DKIM Test successful</figcaption>
</figure>
-<p>Finally, that&rsquo;s actually it for this entry, if you have any problem whatsoever you can <a href="https://luevano.xyz/contact.html">contact me</a>.</p>
<div class="page-nav">
<span class="next">
@@ -459,10 +485,10 @@ systemctl enable spamassassin.service
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, Mar 21, 2021 @ 04:05 UTC</p>
- <p>Modified: Tue, Jun 08, 2021 @ 07:29 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:35 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
</div>
</div>
diff --git a/live/blog/a/new_blogging_system.html b/live/blog/a/new_blogging_system.html
index 066f288..9a06766 100644
--- a/live/blog/a/new_blogging_system.html
+++ b/live/blog/a/new_blogging_system.html
@@ -16,13 +16,12 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
<!-- og meta -->
<meta property="og:title" content="I'm using a new blogging system -- Luevano's Blog"/>
@@ -73,14 +72,20 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>I'm using a new blogging system</h1>
<p>So, I was tired of working with <code>ssg</code> (and then <code>sbg</code> which was a modified version of <code>ssg</code> that I &ldquo;wrote&rdquo;), for one general reason: not being able to extend it as I would like; and not just dumb little stuff, I wanted to be able to have more control, to add tags (which another tool that I found does: <code>blogit</code>), and even more in a future.</p>
<p>The solution? Write a new program &ldquo;from scratch&rdquo; in <em>pYtHoN</em>. Yes it is bloated, yes it is in its early stages, but it works just as I want it to work, and I&rsquo;m pretty happy so far with the results and have with even more ideas in mind to &ldquo;optimize&rdquo; and generally clean my wOrKfLoW to post new blog entries. I even thought of using it for posting into a &ldquo;feed&rdquo; like gallery for drawings or pictures in general.</p>
<p>I called it <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, because it sounds nice and it wasn&rsquo;t taken in the PyPi. It is just a terminal program that reads either a configuration file or the options passed as flags when calling the program.</p>
<p>It still uses Markdown files because I find them very easy to work with. And instead of just having a &ldquo;header&rdquo; and a &ldquo;footer&rdquo; applied to each parsed entry, you will have templates (generated with the program) for each piece that I thought made sense (idea taken from <code>blogit</code>): the common header and footer, the common header and footer for each entry and, header, footer and list elements for articles and tags. When parsing the Markdown file these templates are applied and stitched together to make a single HTML file. Also generates an RSS feed and the <code>sitemap.xml</code> file, which is nice.</p>
-<p>It might sound convoluted, but it works pretty well, with of course room to improve; I&rsquo;m open to suggestions, issue reporting or direct contributions <a href="https://github.com/luevano/pyssg">here</a>. BTW, it only works on Linux for now (and don&rsquo;t think on making it work on windows, but feel free to do PR for the compatibility).</p>
+<p>It might sound convoluted, but it works pretty well, with of course room to improve; I&rsquo;m open to suggestions, issue reporting or direct contributions <a href="https://github.com/luevano/pyssg">here</a>. For now, it is only tested on Linux (and don&rsquo;t think on making it work on windows, but feel free to do PR for the compatibility).</p>
<p>That&rsquo;s it for now, the new RSS feed is available here: <a href="https://blog.luevano.xyz/rss.xml">https://blog.luevano.xyz/rss.xml</a>.</p>
+<p><strong>Update</strong>: Since writing this entry, <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> has evolved quite a bit, so not everything described here is still true. For the latest updates check the newest entries or the git repository itself.</p>
<div class="page-nav">
<span class="next">
@@ -110,7 +115,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Fri, May 28, 2021 @ 03:21 UTC</p>
- <p>Modified: Fri, May 28, 2021 @ 03:42 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:18 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/password_manager_authenticator_setup.html b/live/blog/a/password_manager_authenticator_setup.html
index afd0e45..fbc57d1 100644
--- a/live/blog/a/password_manager_authenticator_setup.html
+++ b/live/blog/a/password_manager_authenticator_setup.html
@@ -16,13 +16,11 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
<meta property="og:title" content="My setup for a password manager and MFA authenticator -- Luevano's Blog"/>
@@ -73,10 +71,15 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>My setup for a password manager and MFA authenticator</h1>
<p><strong>Disclaimer</strong>: I won&rsquo;t go into many technical details here of how to install/configure/use the software, this is just supposed to be a short description on my setup.</p>
-<p>It&rsquo;s been a while since I started using a password manager at all, and I&rsquo;m happy that I started with <a href="https://keepassxc.org/">KeePassXC</a> (open source, multiplatform password manager that it&rsquo;s completely offline) as a direct recommendation from <a href="https://www.lmcj.xyz/">lm</a>; before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by <a href="https://askleo.com/different-passwords-for-everything/">Leo</a> (I don&rsquo;t personally recommed LastPass as Leo does). Note that you will still need a <em>master password</em> to lock/unlock your password database (you can additionally use a hardware key and a key file).</p>
+<p>It&rsquo;s been a while since I started using a password manager at all, and I&rsquo;m happy that I started with <a href="https://keepassxc.org/">KeePassXC</a> (open source, multiplatform password manager that it&rsquo;s completely offline) as a direct recommendation from <a href="https://www.lmcj.xyz/"><mark>EL ELE EME</mark></a>; before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by <a href="https://askleo.com/different-passwords-for-everything/">Leo</a> (I don&rsquo;t personally recommed LastPass as Leo does). Note that you will still need a <em>master password</em> to lock/unlock your password database (you can additionally use a hardware key and a key file).</p>
<p>Anyways, setting up <em>keepass</em> is pretty simple, as there is a client for almost any device; note that <em>keepass</em> is basically just the format and the base for all of the clients, as its common with pretty much any open source software. In my case I&rsquo;m using <a href="https://keepassxc.org/">KeePassXC</a> in my computer and <a href="https://www.keepassdx.com/">KeePassDX</a> in my phone (Android). The only concern is keeping everything in sync because <em>keepass</em> doesn&rsquo;t have any automatic method of synchronizing between devices because of security reasons (as far as I know), meaning that you have to manage that yourself.</p>
<p>Usually you can use something like G**gl* drive, dropbox, mega, nextcloud, or any other cloud solution that you like to sync your <em>keepass</em> database between devices; I personally prefer to use <a href="https://syncthing.net/">Syncthing</a> as it&rsquo;s open source, it&rsquo;s really easy to setup and has worked wonders for me since I started using it, also it keeps versions of your files that can serve as backups in any scenario where the database gets corrupted or something.</p>
<p>Finally, when I went through the issue with the micro SD and the <em>adoptable storage</em> bullshit (you can find the rant <a href="https://blog.luevano.xyz/a/devs_android_me_trozaron.html">here</a>, in spanish) I had to also migrate from <em>G**gl* authenticator</em> (<em>gauth</em>) to something else for the simple reason that <em>gauth</em> doesn&rsquo;t even let you do backups, nor it&rsquo;s synched with your account&hellip; nothing, it is just standalone and if you ever lose your phone you&rsquo;re fucked; so I decided to go with <a href="https://getaegis.app/">Aegis authenticator</a>, as it is open source, you have control over all your secret keys, you can do backups directly to the filesystem, you can secure your database with an extra password, etc., etc.. In general <em>aegis</em> is the superior MFA authenticator (at least compared with <em>gauth</em>) and everything that&rsquo;s compatible with <em>gauth</em> is compatible with <em>aegis</em> as the format is a standard (as a matter of fact, <em>keepass</em> also has this MFA feature which is called TOPT and is also compatible, but I prefer to have things separate). I also use <em>syncthing</em> to keep a backup of my <em>aegis</em> database.</p>
@@ -116,7 +119,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, May 15, 2022 @ 22:40 UTC</p>
- <p>Modified: Sun, May 22, 2022 @ 00:24 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 03:49 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a> </p>
diff --git a/live/blog/a/rewrote_pyssg_again.html b/live/blog/a/rewrote_pyssg_again.html
index 481cb45..a1443d9 100644
--- a/live/blog/a/rewrote_pyssg_again.html
+++ b/live/blog/a/rewrote_pyssg_again.html
@@ -16,13 +16,12 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
<!-- og meta -->
<meta property="og:title" content="Rewrote pyssg again -- Luevano's Blog"/>
@@ -73,9 +72,14 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Rewrote pyssg again</h1>
- <p>I&rsquo;ve been wanting to change the way <a href="https://github.com/luevano/pyssg">pyssg</a> reads config files and generates <code>HTML</code> files so that it is more flexible and I don&rsquo;t need to have 2 separate build commands and configs (for <a href="https://blog.luevano.xyz">blog</a> and <a href="https://art.luevano.xyz">art</a>), and also to handle other types of &ldquo;sites&rdquo;; because <code>pyssg</code> was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of <em>rewrite</em> <code>pyssg</code>, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.</p>
+ <p>I&rsquo;ve been wanting to change the way <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> reads config files and generates <code>HTML</code> files so that it is more flexible and I don&rsquo;t need to have 2 separate build commands and configs (for <a href="https://blog.luevano.xyz">blog</a> and <a href="https://art.luevano.xyz">art</a>), and also to handle other types of &ldquo;sites&rdquo;; because <code>pyssg</code> was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of <em>rewrite</em> <code>pyssg</code>, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.</p>
<p>Anyways, so I bought a new domain for all <code>pyssg</code> related stuff, mostly because I wanted somewhere to test live builds while developing, it is of course <a href="https://pyssg.xyz">pyssg.xyz</a>; as of now it is the same template, CSS and scripts that I use here, probably will change in the future. I&rsquo;ll be testing new features and anything <code>pyssg</code> related stuff.</p>
<p>I should start pointing all links to <code>pyssg</code> to the actual site instead of the github repository (or my <a href="https://git.luevano.xyz">git</a> repository), but I haven&rsquo;t decided how to handle everything.</p>
@@ -101,6 +105,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Tue, Dec 20, 2022 @ 04:31 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 03:57 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/tenia_esto_descuidado.html b/live/blog/a/tenia_esto_descuidado.html
index 76fa1ed..b30a3b7 100644
--- a/live/blog/a/tenia_esto_descuidado.html
+++ b/live/blog/a/tenia_esto_descuidado.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="https://static.luevano.xyz/images/icons/favicon.ico">
-<title>Tenia este pex algo descuidado -- Luevano's Blog</title>
+<title>Tenía este pex algo descuidado -- Luevano's Blog</title>
<meta name="description" content="Nada más un update en el estado del blog y lo que he andado haciendo."/>
<link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luevano's Blog RSS">
<!-- general style -->
@@ -16,16 +16,14 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
- <meta property="og:title" content="Tenia este pex algo descuidado -- Luevano's Blog"/>
+ <meta property="og:title" content="Tenía este pex algo descuidado -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="https://blog.luevano.xyz/a/tenia_esto_descuidado.md"/>
<meta property="og:image" content="https://static.luevano.xyz/images/b/default.png"/>
@@ -73,13 +71,18 @@
</header>
<main>
- <h1>Tenia este pex algo descuidado</h1>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
+ <h1>Tenía este pex algo descuidado</h1>
<p>Así es, tenía un poco descuidado este pex, siendo la razón principal que andaba ocupado con cosas de <em>la vida profesional</em>, ayay. Pero ya que ando un poco más despejado y menos estresado voy a seguir usando el blog y a ver qué más hago.</p>
-<p>Tengo unas entradas pendientes que quiero hacer del estilo de &ldquo;tutorial&rdquo; o &ldquo;how-to&rdquo;, pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en <a href="https://landchad.net/">landchad.net</a>, lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por <a href="https://lmcj.xyz/">lm</a>); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he <em>setupeado</em> desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.</p>
-<p>También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el <em>está bien cabrón</em> pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento (sí, me mamé).</p>
+<p>Tengo unas entradas pendientes que quiero hacer del estilo de &ldquo;tutorial&rdquo; o &ldquo;how-to&rdquo;, pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en <a href="https://landchad.net/">landchad.net</a>, lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por <a href="https://lmcj.xyz/"><mark>EL ELE EME</mark></a>); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he <em>setupeado</em> desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.</p>
+<p>También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el <em>está bien cabrón</em> pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento.</p>
<p>Algo bueno es que me he estado sintiendo muy bien conmigo mismo últimamente, aunque casi no hable de eso. Sí hay una razón en específico, pero es una razón algo tonta. Espero así siga.</p>
-<p>Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien <em>bloated</em>, entonces pues me voy a hacer una en corto seguramente en Python para <em>el back</em>, MySQL para la base de datos y Javascript para la conexión acá en <em>el front</em>, algo tranqui.</p>
+<p><del>Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien <em>bloated</em>, entonces pues me voy a hacer una en corto seguramente en Python para <em>el back</em>, MySQL para la base de datos y Javascript para la conexión acá en <em>el front</em>, algo tranqui.</del> <ins>Nel, siempre no ocupo esto, pa&rsquo; qué.</ins></p>
<p>Sobres pues.</p>
<div class="page-nav">
@@ -110,6 +113,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, Jul 18, 2021 @ 07:51 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:20 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/volviendo_a_usar_la_pagina.html b/live/blog/a/volviendo_a_usar_la_pagina.html
index 8380991..59a898d 100644
--- a/live/blog/a/volviendo_a_usar_la_pagina.html
+++ b/live/blog/a/volviendo_a_usar_la_pagina.html
@@ -16,13 +16,11 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
<!-- og meta -->
<meta property="og:title" content="Volviendo a usar la página -- Luevano's Blog"/>
@@ -73,12 +71,17 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Volviendo a usar la página</h1>
<p>Después de mucho tiempo de estar luchando con querer volver a usar este pex (maldita <em>d</em> word y demás), ya me volví a acomodar el setup para agregar nuevas entradas.</p>
-<p>Entre las cosas que tuve que hacer fue actualizar el <a href="https://github.com/luevano/pyssg">pyssg</a> porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder <em>buildear</em> la página completa; por ahora se hace en segmentos: todo lo de <a href="https://luevano.xyz">luevano.xyz</a> está hecho manual, mientras que <a href="https://blog.luevano.xyz">blog</a> y <a href="https://art.luevano.xyz">art</a> usan <a href="https://github.com/luevano/pyssghttps://github.com/luevano/pyssg">pyssg</a>.</p>
+<p>Entre las cosas que tuve que hacer fue actualizar el <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder <em>buildear</em> la página completa; por ahora se hace en segmentos: todo lo de <a href="https://luevano.xyz">luevano.xyz</a> está hecho manual, mientras que <a href="https://blog.luevano.xyz">blog</a> y <a href="https://art.luevano.xyz">art</a> usan <a href="https://github.com/luevano/pyssg">pyssg</a>.</p>
<p>Otra cosa es que quizá me devuelva a editar alguans entradas nada más para homogeneizar las entradas específicas a <em>Create a&hellip;</em> (tiene más sentido que sean <em>Setup x&hellip;</em> o algo similar).</p>
-<p>En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno por problemas debidos a varias razones (del jale). Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto <em>*thinking emoji*</em>.</p>
+<p>En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno en el jale. Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto <em>*thinking emoji*</em>.</p>
<div class="page-nav">
<span class="next">
@@ -108,7 +111,7 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Thu, Apr 28, 2022 @ 03:21 UTC</p>
- <p>Modified: Thu, Apr 28, 2022 @ 03:28 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:23 UTC</p>
<div class="article-tags">
<p>Tags:
<a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
diff --git a/live/blog/a/vpn_server_with_openvpn.html b/live/blog/a/vpn_server_with_openvpn.html
index de80c45..6109f37 100644
--- a/live/blog/a/vpn_server_with_openvpn.html
+++ b/live/blog/a/vpn_server_with_openvpn.html
@@ -16,14 +16,21 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Create a VPN server with OpenVPN (IPv4) -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,18 +80,36 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Create a VPN server with OpenVPN (IPv4)</h1>
<p>I&rsquo;ve been wanting to do this entry, but had no time to do it since I also have to set up the VPN service as well to make sure what I&rsquo;m writing makes sense, today is the day.</p>
<p>Like with any other of my entries I based my setup on the <a href="https://wiki.archlinux.org/title/OpenVPN">Arch Wiki</a>, <a href="https://github.com/Nyr/openvpn-install">this install script</a> and <a href="https://github.com/graysky2/ovpngen">this profile generator script</a>.</p>
-<p>This will be installed and working alongside the other stuff I&rsquo;ve wrote about on other posts (see the <a href="https://blog.luevano.xyz/tag/@server.html">server</a> tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it&rsquo;s not that hard to include IPv6, but meh).</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+<p>This will be installed and working alongside the other stuff I&rsquo;ve wrote about on other posts (see the <a href="https://blog.luevano.xyz/tag/@server.html">server</a> tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it&rsquo;s not that hard to include IPv6, but meh). As always, all commands are executed as root unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#create-pki-from-scratch">Create PKI from scratch</a></li>
+<li><a href="#openvpn">OpenVPN</a><ul>
+<li><a href="#enable-forwarding">Enable forwarding</a></li>
+<li><a href="#create-client-configurations">Create client configurations</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Pretty simple:</p>
<ul>
-<li>Working server with root access, and with Ufw as the firewall.</li>
-<li>Depending on what port you want to run the VPN on, the default <code>1194</code>, or as a fallback on <code>443</code> (click <a href="https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/">here</a> for more). I will do mine on port <code>1194</code> but it&rsquo;s just a matter of changing 2 lines of configuration and one Ufw rule.</li>
+<li>Working server with root access, and with <code>ufw</code> as the firewall.</li>
+<li>Depending on what port you want to run the VPN on, the default <code>1194</code>, or as a fallback on <code>443</code> (click <a href="https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/">here</a> for more). I will do mine on port <code>1194</code> but it&rsquo;s just a matter of changing 2 lines of configuration and one <code>ufw</code> rule.</li>
</ul>
-<h3 id="create-pki-from-scratch">Create PKI from scratch<a class="headerlink" href="#create-pki-from-scratch" title="Permanent link">&para;</a></h3>
+<h2 id="create-pki-from-scratch">Create PKI from scratch<a class="headerlink" href="#create-pki-from-scratch" title="Permanent link">&para;</a></h2>
<p>PKI stands for <em>Public Key Infrastructure</em> and basically it&rsquo;s required for certificates, private keys and more. This is supposed to work between two servers and one client: a server in charge of creating, signing and verifying the certificates, a server with the OpenVPN service running and the client making the request.</p>
<p>This is supposed to work something like: 1) a client wants to use the VPN service, so it creates a requests and sends it to the signing server, 2) this server checks the requests and signs the request, returning the certificates to both the VPN service and the client and 3) the client can now connect to the VPN service using the signed certificate which the OpenVPN server knows about. In a nutshell, I&rsquo;m no expert.</p>
<p>&hellip; but, to be honest, all of this is a hassle and (in my case) I want something simple to use and manage. So I&rsquo;m gonna do all on one server and then just give away the configuration file for the clients, effectively generating files that anyone can run and will work, meaning that you need to be careful who you give this files (it also comes with a revoking mechanism, so no worries).</p>
@@ -128,8 +153,8 @@ openssl dhparam -out dh.pem 2048
openvpn --genkey secret ta.key
</code></pre>
<p>That&rsquo;s it for the PKI stuff and general certificate configuration.</p>
-<h3 id="openvpn">OpenVPN<a class="headerlink" href="#openvpn" title="Permanent link">&para;</a></h3>
-<p><a href="https://wiki.archlinux.org/title/OpenVPN">OpenVPN</a> is a robust and highly flexible VPN daemon, that&rsquo;s pretty complete feature wise.</p>
+<h2 id="openvpn">OpenVPN<a class="headerlink" href="#openvpn" title="Permanent link">&para;</a></h2>
+<p><a href="https://wiki.archlinux.org/title/OpenVPN">OpenVPN</a> is a robust and highly flexible VPN daemon, that&rsquo;s pretty complete feature-wise.</p>
<p>Install the <code>openvpn</code> package:</p>
<pre><code class="language-sh">pacman -S openvpn
</code></pre>
@@ -231,6 +256,7 @@ verb 3
explicit-exit-notify 1
</code></pre>
<p><code>#</code> and <code>;</code> are comments. Read each and every line, you might want to change some stuff (like the logging), specially the first line which is your server public IP.</p>
+<h4 id="enable-forwarding">Enable forwarding<a class="headerlink" href="#enable-forwarding" title="Permanent link">&para;</a></h4>
<p>Now, we need to enable <em>packet forwarding</em> (so we can access the web while connected to the VPN), which can be enabled on the interface level or globally (you can check the different options with <code>sysctl -a | grep forward</code>). I&rsquo;ll do it globally, run:</p>
<pre><code class="language-sh">sysctl net.ipv4.ip_forward=1
</code></pre>
@@ -276,7 +302,7 @@ ufw reload
systemctl enable openvpn-server@server.service
</code></pre>
<p>Where the <code>server</code> after <code>@</code> is the name of your configuration, <code>server.conf</code> without the <code>.conf</code> in my case.</p>
-<h4 id="create-client-configurations">Create client configurations<a class="headerlink" href="#create-client-configurations" title="Permanent link">&para;</a></h4>
+<h3 id="create-client-configurations">Create client configurations<a class="headerlink" href="#create-client-configurations" title="Permanent link">&para;</a></h3>
<p>You might notice that I didn&rsquo;t specify how to actually connect to our server. For that we need to do a few more steps. We actually need a configuration file similar to the <code>server.conf</code> file that we created.</p>
<p>The real way of doing this would be to run similar steps as the ones with <code>easy-rsa</code> locally, send them to the server, sign them, and retrieve them. Nah, we&rsquo;ll just create all configuration files on the server as I was mentioning earlier.</p>
<p>Also, the client configuration file has to match the server one (to some degree), to make this easier you can create a <code>client-common</code> file in <code>/etc/openvpn/server</code> with the following content:</p>
@@ -349,7 +375,7 @@ chown nobody:nobody pki/crl.pem
chmod o+r pki/crl.pem
cd $CPWD
</code></pre>
-<p>And the way to use is to run <code>vpn_script new/rev client_name</code> as sudo (when revoking, it doesn&rsquo;t actually deletes the <code>.ovpn</code> file in <code>~/ovpn</code>). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for <code>easy-rsa</code>) and it could have errors.</p>
+<p>And the way to use is to run <code>vpn_script new/rev client_name</code> as sudo (when revoking, it doesn&rsquo;t actually delete the <code>.ovpn</code> file in <code>~/ovpn</code>). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for <code>easy-rsa</code>).</p>
<p>Now, just get the <code>.ovpn</code> file generated, import it to OpenVPN in your client of preference and you should have a working VPN service.</p>
<div class="page-nav">
@@ -380,10 +406,10 @@ cd $CPWD
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, Aug 01, 2021 @ 09:27 UTC</p>
- <p>Modified: Sun, Aug 01, 2021 @ 10:13 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:36 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
</div>
</div>
diff --git a/live/blog/a/website_with_nginx.html b/live/blog/a/website_with_nginx.html
index 386b95d..6070c82 100644
--- a/live/blog/a/website_with_nginx.html
+++ b/live/blog/a/website_with_nginx.html
@@ -16,14 +16,21 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Create a website with Nginx and Certbot -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,25 +80,39 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Create a website with Nginx and Certbot</h1>
<p>These are general notes on how to setup a Nginx web server plus Certbot for SSL certificates, initially learned from <a href="https://www.youtube.com/watch?v=OWAqilIVNgE">Luke&rsquo;s video</a> and after some use and research I added more stuff to the mix. And, actually at the time of writing this entry, I&rsquo;m configuring the web server again on a new VPS instance, so this is going to be fresh.</p>
-<p>As a side note, (((i use arch btw))) so everything here es aimed at an Arch Linux distro, and I&rsquo;m doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+<p>As a side note, <mark>i use arch btw</mark> so everything here es aimed at an Arch Linux distro, and I&rsquo;m doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#nginx">Nginx</a></li>
+<li><a href="#certbot">Certbot</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>You will need two things:</p>
<ul>
<li>A domain name (duh!). I got mine on <a href="https://www.epik.com/?affid=da5ne9ru4">Epik</a> (affiliate link, btw).<ul>
-<li>With the corresponding <strong>A</strong> and <strong>AAA</strong> records pointing to the VPS&rsquo; IPs (&ldquo;A&rdquo; record points to the ipv4 address and &ldquo;AAA&rdquo; to the ipv6, basically). I have three records for each type: empty one, &ldquo;www&rdquo; and &ldquo;*&rdquo; for a wildcard, that way &ldquo;domain.name&rdquo;, &ldquo;www.domain.name&rdquo;, &ldquo;anythingelse.domain.name&rdquo; point to the same VPS (meaning that you can have several VPS for different sub-domains).</li>
+<li>With the corresponding <strong>A</strong> and <strong>AAA</strong> records pointing to the VPS&rsquo; IPs. I have three records for each type: empty string, &ldquo;www&rdquo; and &ldquo;*&rdquo; for a wildcard, that way &ldquo;domain.name&rdquo;, &ldquo;www.domain.name&rdquo;, &ldquo;anythingelse.domain.name&rdquo; point to the same VPS (meaning that you can have several VPS for different sub-domains). These depend on the VPS provider.</li>
</ul>
</li>
-<li>A VPS or somewhere else to host it. I&rsquo;m using <a href="https://www.vultr.com/?ref=8732849">Vultr</a> (also an affiliate link).<ul>
+<li>A VPS or somewhere else to host it. I&rsquo;m using <a href="https://www.vultr.com/?ref=8732849">Vultr</a> (also an affiliate link, btw).<ul>
<li>With <code>ssh</code> already configured both on the local machine and on the remote machine.</li>
-<li>Firewall already configured to allow ports 80 (HTTP) and 443 (HTTPS). I use <code>ufw</code> so it&rsquo;s just a matter of doing <code>ufw allow 80,443/tcp</code> as root and you&rsquo;re golden.</li>
-<li><code>cron</code> installed if you follow along (you could use <code>systemd</code> timers, or some other method you prefer to automate running commands every X time).</li>
+<li>Firewall already configured to allow ports <code>80</code> (HTTP) and <code>443</code> (HTTPS). I use <code>ufw</code> so it&rsquo;s just a matter of doing <code>ufw allow 80,443/tcp</code> (for example) as root and you&rsquo;re golden.</li>
+<li><code>cron</code> installed if you follow along (you could use <code>systemd</code> timers, or some other method you prefer to automate running commands every certain time).</li>
</ul>
</li>
</ul>
-<h3 id="nginx">Nginx<a class="headerlink" href="#nginx" title="Permanent link">&para;</a></h3>
+<h2 id="nginx">Nginx<a class="headerlink" href="#nginx" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Nginx">Nginx</a> is a web (HTTP) server and reverse proxy server.</p>
<p>You have two options: <code>nginx</code> and <code>nginx-mainline</code>. I prefer <code>nginx-mainline</code> because it&rsquo;s the &ldquo;up to date&rdquo; package even though <code>nginx</code> is labeled to be the &ldquo;stable&rdquo; version. Install the package and enable/start the service:</p>
<pre><code class="language-sh">pacman -S nginx-mainline
@@ -100,7 +121,7 @@ systemctl start nginx.service
</code></pre>
<p>And that&rsquo;s it, at this point you can already look at the default initial page of Nginx if you enter the IP of your server in a web browser. You should see something like this:</p>
<figure id="__yafg-figure-1">
-<img alt="Nginx welcome page" src="images/b/notes/nginx/nginx_welcome_page.png" title="Nginx welcome page">
+<img alt="Nginx welcome page" src="https://static.luevano.xyz/images/b/notes/nginx/nginx_welcome_page.png" title="Nginx welcome page">
<figcaption>Nginx welcome page</figcaption>
</figure>
<p>As stated in the welcome page, configuration is needed, head to the directory of Nginx:</p>
@@ -167,7 +188,7 @@ systemctl restart nginx
</code></pre>
<p>If everything goes correctly, you can now go to your website by typing <code>domain.name</code> on a web browser. But you will see a &ldquo;404 Not Found&rdquo; page like the following (maybe with different Nginx version):</p>
<figure id="__yafg-figure-2">
-<img alt="Nginx 404 Not Found page" src="images/b/notes/nginx/nginx_404_page.png" title="Nginx 404 Not Found page">
+<img alt="Nginx 404 Not Found page" src="https://static.luevano.xyz/images/b/notes/nginx/nginx_404_page.png" title="Nginx 404 Not Found page">
<figcaption>Nginx 404 Not Found page</figcaption>
</figure>
<p>That&rsquo;s no problem, because it means that the web server it&rsquo;s actually working. Just add an <code>index.html</code> file with something simple to see it in action (in the <code>/var/www/some_folder</code> that you decided upon). If you keep seeing the 404 page make sure your <code>root</code> line is correct and that the directory/index file exists.</p>
@@ -180,7 +201,7 @@ systemctl restart nginx
try_files $uri/index.html $uri.html $uri/ $uri =404;
...
</code></pre>
-<h3 id="certbot">Certbot<a class="headerlink" href="#certbot" title="Permanent link">&para;</a></h3>
+<h2 id="certbot">Certbot<a class="headerlink" href="#certbot" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Certbot">Certbot</a> is what provides the SSL certificates via <a href="https://letsencrypt.org/">Let&rsquo;s Encrypt</a>.</p>
<p>The only &ldquo;bad&rdquo; (bloated) thing about Certbot, is that it uses <code>python</code>, but for me it doesn&rsquo;t matter too much. You may want to look up another alternative if you prefer. Install the packages <code>certbot</code> and <code>certbot-nginx</code>:</p>
<pre><code class="language-sh">pacman -S certbot certbot-nginx
@@ -192,7 +213,7 @@ systemctl restart nginx
<p>Now, the certificate given by <code>certbot</code> expires every 3 months or something like that, so you want to renew this certificate every once in a while. Using <code>cron</code>, you can do this by running:</p>
<pre><code class="language-sh">crontab -e
</code></pre>
-<p>And a file will be opened where you need to add a new rule for Certbot, just append the line: <code>1 1 1 * * certbot renew</code> (renew on the first day of every month) and you&rsquo;re good. Alternatively use <code>systemd</code> timers as stated in the <a href="https://wiki.archlinux.org/title/Certbot#Automatic_renewal">Arch Linux Wiki</a>.</p>
+<p>And a file will be opened where you need to add a new rule for Certbot, just append the line: <code>1 1 1 * * certbot renew --quiet --agree-tos --deploy-hook "systemctl reload nginx.service"</code> (renew on the first day of every month) and you&rsquo;re good. Alternatively use <code>systemd</code> timers as stated in the <a href="https://wiki.archlinux.org/title/Certbot#Automatic_renewal">Arch Linux Wiki</a>.</p>
<p>That&rsquo;s it, you now have a website with SSL certificate.</p>
<div class="page-nav">
@@ -223,10 +244,10 @@ systemctl restart nginx
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Fri, Mar 19, 2021 @ 02:58 UTC</p>
- <p>Modified: Tue, Jun 08, 2021 @ 07:27 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:34 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
</div>
</div>
diff --git a/live/blog/a/xmpp_server_with_prosody.html b/live/blog/a/xmpp_server_with_prosody.html
index 20418ca..9a83ac4 100644
--- a/live/blog/a/xmpp_server_with_prosody.html
+++ b/live/blog/a/xmpp_server_with_prosody.html
@@ -16,14 +16,21 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Create an XMPP server with Prosody compatible with Conversations and Movim -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,12 +80,29 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Create an XMPP server with Prosody compatible with Conversations and Movim</h1>
- <p>Recently I set up an XMPP server (and a Matrix one, too) for my personal use and for friends if they want one; made one for <mark><a href="https://lmcj.xyz">EL ELE EME</a></mark> for example. So, here are the notes on how I set up the server that is compatible with the <a href="https://conversations.im/">Conversations</a> app and the <a href="https://movim.eu/">Movim</a> social network. You can see my addresses in <a href="https://luevano.xyz/contact.html">contact</a> and the XMPP compliance/score of the server.</p>
-<p>One of the best resources I found that helped me a lot was <a href="https://community.hetzner.com/tutorials/prosody-debian9">Installing and Configuring Prosody XMPP Server on Debian 9</a>, and of course the <a href="https://wiki.archlinux.org/title/Prosody">Arch Wiki</a> and the <a href="https://prosody.im/">oficial documentation</a>.</p>
-<p>As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root (unless specified otherwise)</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <p><strong>Update</strong>: I no longer host this XMPP server as it consumed a lot of resources and I wasn&rsquo;t using it that much. I&rsquo;ll probably re-create it in the future, though.</p>
+<p>Recently I set up an <a href="https://xmpp.org/">XMPP</a> server (and a Matrix one, too) for my personal use and for friends if they want one; made one for <a href="https://lmcj.xyz"><mark>EL ELE EME</mark></a> for example. So, here are the notes on how I set up the server that is compatible with the <a href="https://conversations.im/">Conversations</a> app and the <a href="https://movim.eu/">Movim</a> social network. You can see my addresses at <a href="https://luevano.xyz/contact.html">contact</a> and the XMPP compliance/score of the server.</p>
+<p>One of the best resources I found that helped me a lot was <a href="https://community.hetzner.com/tutorials/prosody-debian9">Installing and Configuring Prosody XMPP Server on Debian 9</a>, the <a href="https://wiki.archlinux.org/title/Prosody">Arch Wiki</a> and the <a href="https://prosody.im/">oficial documentation</a>.</p>
+<p>As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root, unless specified otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#prosody">Prosody</a></li>
+<li><a href="#nginx-configuration-file">Nginx configuration file</a></li>
+<li><a href="#coturn">Coturn</a></li>
+<li><a href="#wrapping-up">Wrapping up</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Same as with my other entries (<a href="https://luevano.xyz/a/website_with_nginx.html">website</a>, <a href="https://blog.luevano.xyz/a/mail_server_with_postfix.html">mail</a> and <a href="https://blog.luevano.xyz/a/git_server_with_cgit.html">git</a>) plus:</p>
<ul>
<li><strong>A</strong> and (optionally) <strong>AAA</strong> DNS records for:<ul>
@@ -90,16 +114,16 @@
</ul>
</li>
<li>(Optionally, but recommended) the following <strong>SRV</strong> DNS records; make sure it is pointing to an <strong>A</strong> or <strong>AAA</strong> record (matching the records from the last point, for example):<ul>
-<li><code>_xmpp-client._tcp.**your.domain**.</code> for port <code>5222</code> pointing to <code>xmpp.**your.domain**.</code></li>
-<li><code>_xmpp-server._tcp.**your.domain**.</code> for port <code>5269</code> pointing to <code>xmpp.**your.domain**.</code></li>
-<li><code>_xmpp-server._tcp.muc.**your.domain**.</code> for port <code>5269</code> pointing to <code>xmpp.**your.domain**.</code></li>
+<li><code>_xmpp-client._tcp.{your.domain}.</code> for port <code>5222</code> pointing to <code>xmpp.{your.domain}.</code></li>
+<li><code>_xmpp-server._tcp.{your.domain}.</code> for port <code>5269</code> pointing to <code>xmpp.{your.domain}.</code></li>
+<li><code>_xmpp-server._tcp.muc.{your.domain}.</code> for port <code>5269</code> pointing to <code>xmpp.{your.domain}.</code></li>
</ul>
</li>
<li>SSL certificates for the previous subdomains; similar that with my other entries just create the appropriate <code>prosody.conf</code> (where <code>server_name</code> will be all the subdomains defined above) file and run <code>certbot --nginx</code>. You can find the example configuration file almost at the end of this entry.</li>
<li>Email addresses for <code>admin</code>, <code>abuse</code>, <code>contact</code>, <code>security</code>, etc. Or use your own email for all of them, doesn&rsquo;t really matter much as long as you define them in the configuration and are valid, I have aliases so those emails are forwarded to me.</li>
<li>Allow ports <code>5000</code>, <code>5222</code>, <code>5269</code>, <code>5280</code> and <code>5281</code> for <a href="https://prosody.im/doc/ports">Prosody</a> and, <code>3478</code> and <code>5349</code> for <a href="https://webrtc.org/getting-started/turn-server">Turnserver</a> which are the defaults for <code>coturn</code>.</li>
</ul>
-<h3 id="prosody">Prosody<a class="headerlink" href="#prosody" title="Permanent link">&para;</a></h3>
+<h2 id="prosody">Prosody<a class="headerlink" href="#prosody" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Prosody">Prosody</a> is an implementation of the XMPP protocol that is flexible and extensible.</p>
<p>Install the <code>prosody</code> package (with optional dependencies) and the <code>mercurial</code> package:</p>
<pre><code class="language-sh">pacman -S prosody, mercurial, lua52-sec, lua52-dbi, lua52-zlib
@@ -111,11 +135,11 @@ mkdir modules-enabled
</code></pre>
<p>You can see that I follow a similar approach that I used with Nginx and the server configuration, where I have all the modules available in a directory, and make a symlink to another to keep track of what is being used. You can update the repository by running <code>hg pull --update</code> while inside the <code>modules-available</code> directory (similar to Git).</p>
<p>Make symbolic links to the following modules:</p>
-<pre><code>ln -s /var/lib/prosody/modules-available/MODULE_NAME /var/lib/prosody/modules-enabled/
+<pre><code>ln -s /var/lib/prosody/modules-available/{module_name} /var/lib/prosody/modules-enabled/
...
</code></pre>
<ul>
-<li>Modules:<ul>
+<li>Modules (<code>{module_name}</code>):<ul>
<li><code>mod_bookmarks</code></li>
<li><code>mod_cache_c2s_caps</code></li>
<li><code>mod_checkcerts</code></li>
@@ -443,8 +467,8 @@ ln -s your.domain.key SUBDOMAIN.your.domain.key
...
</code></pre>
<p>That&rsquo;s basically all the configuration that needs Prosody itself, but we still have to configure Nginx and Coturn before starting/enabling the <code>prosody</code> service.</p>
-<h3 id="nginx-configuration-file">Nginx configuration file<a class="headerlink" href="#nginx-configuration-file" title="Permanent link">&para;</a></h3>
-<p>Since this is not an ordinary configuration file I&rsquo;m going to describe this too. Your <code>prosody.conf</code> file should have the following location blocks under the main server block (the one that listens to HTTPS):</p>
+<h2 id="nginx-configuration-file">Nginx configuration file<a class="headerlink" href="#nginx-configuration-file" title="Permanent link">&para;</a></h2>
+<p>Since this is not an ordinary configuration file I&rsquo;m going to describe this, too. Your <code>prosody.conf</code> file should have the following location blocks under the main server block (the one that listens to HTTPS):</p>
<pre><code class="language-nginx"># HTTPS server block
server {
root /var/www/prosody/;
@@ -537,11 +561,11 @@ server {
]
}
</code></pre>
-<p>Remember to have your <code>prosody.conf</code> file symlinked (or discoverable by Nginx) to the <code>sites-enabled</code> directory. You can now restart your <code>nginx</code> service (and test the configuration, optionally):</p>
+<p>Remember to have your <code>prosody.conf</code> file symlinked (or discoverable by Nginx) to the <code>sites-enabled</code> directory. You can now test and restart your <code>nginx</code> service (and test the configuration, optionally):</p>
<pre><code class="language-sh">nginx -t
systemctl restart nginx.service
</code></pre>
-<h3 id="coturn">Coturn<a class="headerlink" href="#coturn" title="Permanent link">&para;</a></h3>
+<h2 id="coturn">Coturn<a class="headerlink" href="#coturn" title="Permanent link">&para;</a></h2>
<p><a href="https://github.com/coturn/coturn">Coturn</a> is the implementation of TURN and STUN server, which in general is for (at least in the XMPP world) voice support and external service discovery.</p>
<p>Install the <code>coturn</code> package:</p>
<pre><code class="language-sh">pacman -S coturn
@@ -557,7 +581,7 @@ static-auth-secret=YOUR SUPER SECRET TURN PASSWORD
systemctl enable turnserver.service
</code></pre>
<p>You can test if your TURN server works at <a href="https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/">Trickle ICE</a>. You may need to add a user in the <code>turnserver.conf</code> to test this.</p>
-<h3 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h3>
+<h2 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h2>
<p>At this point you should have a working XMPP server, start/enable the <code>prosody</code> service now:</p>
<pre><code class="language-sh">systemctl start prosody.service
systemctl enable prosody.service
@@ -570,7 +594,7 @@ systemctl enable prosody.service
<p>Additionally, you can test the security of your server in <a href="https://xmpp.net/index.php">IM Observatory</a>, here you only need to specify your <code>domain.name</code> (not <code>xmpp.domain.name</code>, if you set up the <strong>SRV</strong> DNS records correctly). Again, it should have a similar score to mine:</p>
<p><a href='https://xmpp.net/result.php?domain=luevano.xyz&amp;type=client'><img src='https://xmpp.net/badge.php?domain=luevano.xyz' alt='xmpp.net score' /></a></p>
<p>You can now log in into your XMPP client of choice, if it asks for the server it should be <code>xmpp.your.domain</code> (or <code>your.domain</code> for some clients) and your login credentials <code>you@your.domain</code> and the password you chose (which you can change in most clients).</p>
-<p>That&rsquo;s it, send me a message <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.</p>
+<p>That&rsquo;s it, send me a message at <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.</p>
<div class="page-nav">
<span class="next">
@@ -600,10 +624,10 @@ systemctl enable prosody.service
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Wed, Jun 09, 2021 @ 05:24 UTC</p>
- <p>Modified: Tue, Dec 20, 2022 @ 04:33 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:36 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a> </p>
</div>
</div>
diff --git a/live/blog/g/flappybird_godot_devlog_1.html b/live/blog/g/flappybird_godot_devlog_1.html
index 6f37a66..0162350 100644
--- a/live/blog/g/flappybird_godot_devlog_1.html
+++ b/live/blog/g/flappybird_godot_devlog_1.html
@@ -16,14 +16,22 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+
+
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+ <!-- Specific to GDScript -->
+ <script type="text/javascript" src="https://static.luevano.xyz/hl/languages/gdscript.min.js"></script>
+
<!-- og meta -->
<meta property="og:title" content="Creating a FlappyBird clone in Godot 3.5 devlog 1 -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,9 +81,14 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Creating a FlappyBird clone in Godot 3.5 devlog 1</h1>
- <p>I just have a bit of experience with Godot and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:</p>
+ <p>I just have a bit of experience with <em>Godot</em> and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:</p>
<ul>
<li>Literally just one sprite going up and down.</li>
<li>Constant horizontal move of the world/player.</li>
@@ -85,189 +98,246 @@
<p>The game was originally developed with <em>Godot 4.0 alpha 8</em>, but it didn&rsquo;t support HTML5 (webassembly) export&hellip; so I backported to <em>Godot 3.5 rc1</em>.</p>
<p>Not going to specify all the details, only the needed parts and what could be confusing, as the source code is available and can be inspected; also this assumes minimal knowledge of <em>Godot</em> in general. Usually when I mention that a set/change of something it usually it&rsquo;s a property and it can be found under the <em>Inspector</em> on the relevant node, unless stated otherwise; also, all scripts attached have the same name as the scenes, but in <em>snake_case</em> (scenes/nodes in <em>PascalCase</em>).</p>
<p>One thing to note, is that I started writing this when I finished the game, so it&rsquo;s hard to go part by part, and it will be hard to test individual parts when going through this as everything is depending on each other. For the next devlog, I&rsquo;ll do it as I go and it will include all the changes to the nodes/scripts as I was finding them, probably better idea and easier to follow.</p>
-<p>The source code can be found in my GitHub <a href="https://github.com/luevano/flappybird_godot">here</a>, it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I&rsquo;m too lazy to make it configurable, it was the last thing I added), or you could also go to the itch.io page I setup where it&rsquo;s playable in the browser:</p>
-<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
+<p>The source code can be found in my GitHub <a href="https://github.com/luevano/flappybird_godot">here</a>, it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I&rsquo;m too lazy to make it configurable, it was the last thing I added), or you could also go to the <a href="https://lorentzeus.itch.io/flappybirdgodot">itch.io</a> page I setup where it&rsquo;s playable in the browser:</p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
-<h3 id="initial-project-setup">Initial project setup<a class="headerlink" href="#initial-project-setup" title="Permanent link">&para;</a></h3>
-<h4 id="directory-structure">Directory structure<a class="headerlink" href="#directory-structure" title="Permanent link">&para;</a></h4>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#initial-setup">Initial setup</a><ul>
+<li><a href="#directory-structure">Directory structure</a></li>
+<li><a href="#config">Config</a><ul>
+<li><a href="#default-import-settings">Default import settings</a></li>
+<li><a href="#general-settings">General settings</a></li>
+<li><a href="#keybindings">Keybindings</a></li>
+<li><a href="#layers">Layers</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#assets">Assets</a><ul>
+<li><a href="#importing">Importing</a></li>
+</ul>
+</li>
+<li><a href="#scenes">Scenes</a><ul>
+<li><a href="#tilemaps">TileMaps</a><ul>
+<li><a href="#default-ground-tiles">Default ground tiles</a></li>
+</ul>
+</li>
+<li><a href="#player">Player</a></li>
+<li><a href="#other">Other</a></li>
+<li><a href="#game">Game</a></li>
+<li><a href="#ui">UI</a><ul>
+<li><a href="#fonts">Fonts</a></li>
+<li><a href="#scene-setup">Scene setup</a></li>
+</ul>
+</li>
+<li><a href="#main">Main</a></li>
+</ul>
+</li>
+<li><a href="#scripting">Scripting</a><ul>
+<li><a href="#player_1">Player</a></li>
+<li><a href="#worlddetector">WorldDetector</a></li>
+<li><a href="#worldtiles">WorldTiles</a><ul>
+<li><a href="#groundtilemap">GroundTileMap</a></li>
+<li><a href="#pipetilemap">PipeTileMap</a></li>
+</ul>
+</li>
+<li><a href="#saved-data">Saved data</a></li>
+<li><a href="#game_1">Game</a></li>
+<li><a href="#ui_1">UI</a></li>
+<li><a href="#main_1">Main</a></li>
+</ul>
+</li>
+<li><a href="#final-notes-and-exporting">Final notes and exporting</a><ul>
+<li><a href="#preparing-the-files">Preparing the files</a></li>
+<li><a href="#exporting">Exporting</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h2>
+<h3 id="directory-structure">Directory structure<a class="headerlink" href="#directory-structure" title="Permanent link">&para;</a></h3>
<p>I&rsquo;m basically going with what I wrote on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> recently, and probably with minor changes depending on the situation.</p>
-<h4 id="config">Config<a class="headerlink" href="#config" title="Permanent link">&para;</a></h4>
-<h5 id="default-import-settings">Default import settings<a class="headerlink" href="#default-import-settings" title="Permanent link">&para;</a></h5>
+<h3 id="config">Config<a class="headerlink" href="#config" title="Permanent link">&para;</a></h3>
+<h4 id="default-import-settings">Default import settings<a class="headerlink" href="#default-import-settings" title="Permanent link">&para;</a></h4>
<p>Since this is just pixel art, the importing settings for textures needs to be adjusted so the sprites don&rsquo;t look blurry. Go to <em>Project -&gt; Project settings&hellip; -&gt; Import defaults</em> and on the drop down select <code>Texture</code>, untick everything and make sure <em>Compress/Mode</em> is set to <code>Lossless</code>.</p>
<figure id="__yafg-figure-4">
-<img alt="Project settings - Import defaults - Texture settings" src="images/g/flappybird_godot/project_settings_import_texture.png" title="Project settings - Import defaults - Texture settings">
+<img alt="Project settings - Import defaults - Texture settings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_import_texture.png" title="Project settings - Import defaults - Texture settings">
<figcaption>Project settings - Import defaults - Texture settings</figcaption>
</figure>
-<h5 id="general-settings">General settings<a class="headerlink" href="#general-settings" title="Permanent link">&para;</a></h5>
+<h4 id="general-settings">General settings<a class="headerlink" href="#general-settings" title="Permanent link">&para;</a></h4>
<p>It&rsquo;s also a good idea to setup some config variables project-wide. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Application/config</em> and add a new property (there is a text box at the top of the project settings window) for game scale: <code>application/config/game_scale</code> for the type use <code>float</code> and then click on add; configure the new property to <code>3.0</code>; On the same window, also add <code>application/config/version</code> as a <code>string</code>, and make it <code>1.0.0</code> (or whatever number you want).</p>
<figure id="__yafg-figure-5">
-<img alt="Project settings - General - Game scale and version properties" src="images/g/flappybird_godot/project_settings_config_properties.png" title="Project settings - General - Game scale and version properties">
+<img alt="Project settings - General - Game scale and version properties" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_config_properties.png" title="Project settings - General - Game scale and version properties">
<figcaption>Project settings - General - Game scale and version properties</figcaption>
</figure>
-<p>For my personal preferences, also disable some of the <em>GDScript</em> debug warnings that are annoying, this is done at <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Debug/GDScript</em> and toggle off &ldquo;Unused arguments&rdquo;, &ldquo;Unused signal&rdquo; and &ldquo;Return value discarded&rdquo;, and any other that might come up too often and don&rsquo;t want to see.</p>
+<p>For my personal preferences, also disable some of the <em>GDScript</em> debug warnings that are annoying, this is done at <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Debug/GDScript</em> and toggle off <code>Unused arguments</code>, <code>Unused signal</code> and <code>Return value discarded</code>, and any other that might come up too often and don&rsquo;t want to see.</p>
<figure id="__yafg-figure-6">
-<img alt="Project settings - General - GDScript debug warnings" src="images/g/flappybird_godot/project_settings_debug_gdscript.png" title="Project settings - General - GDScript debug warnings">
+<img alt="Project settings - General - GDScript debug warnings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_debug_gdscript.png" title="Project settings - General - GDScript debug warnings">
<figcaption>Project settings - General - GDScript debug warnings</figcaption>
</figure>
-<p>Finally, set the initial window size in <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Display/Window</em> and set <em>Size/Width</em> and <em>Size/Height</em> to <code>600</code> and <code>800</code>, respectively. As well as the <em>Stretch/Mode</em> to &ldquo;viewport&rdquo;, and <em>Stretch/Aspect</em> to &ldquo;keep&rdquo;:</p>
+<p>Finally, set the initial window size in <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Display/Window</em> and set <em>Size/Width</em> and <em>Size/Height</em> to <code>600</code> and <code>800</code>, respectively. As well as the <em>Stretch/Mode</em> to <code>viewport</code> , and <em>Stretch/Aspect</em> to <code>keep</code>:</p>
<figure id="__yafg-figure-7">
-<img alt="Project settings - General - Initial window size" src="images/g/flappybird_godot/project_settings_window_settings.png" title="Project settings - General - Initial window size">
+<img alt="Project settings - General - Initial window size" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_window_settings.png" title="Project settings - General - Initial window size">
<figcaption>Project settings - General - Initial window size</figcaption>
</figure>
-<h5 id="keybindings">Keybindings<a class="headerlink" href="#keybindings" title="Permanent link">&para;</a></h5>
-<p>I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the <code>Input.something()</code> API can be used), go to <em>Project -&gt; Project settings&hellip; -&gt; Input Map</em> and on the text box write &ldquo;jump&rdquo; and click add, then it will be added to the list and it&rsquo;s just a matter of clicking the <code>+</code> sign to add a &ldquo;Physical key&rdquo;, press any key you want to be used to jump and click ok. Do the same for the rest of the actions.</p>
+<h4 id="keybindings">Keybindings<a class="headerlink" href="#keybindings" title="Permanent link">&para;</a></h4>
+<p>I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the <code>Input.something()</code> API can be used), go to <em>Project -&gt; Project settings&hellip; -&gt; Input Map</em> and on the text box write <code>jump</code> and click add, then it will be added to the list and it&rsquo;s just a matter of clicking the <code>+</code> sign to add a <em>Physical key</em>, press any key you want to be used to jump and click ok. Do the same for the rest of the actions.</p>
<figure id="__yafg-figure-8">
-<img alt="Project settings - Input Map - Adding necessary keybindings" src="images/g/flappybird_godot/project_settings_input_map.png" title="Project settings - Input Map - Adding necessary keybindings">
+<img alt="Project settings - Input Map - Adding necessary keybindings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_input_map.png" title="Project settings - Input Map - Adding necessary keybindings">
<figcaption>Project settings - Input Map - Adding necessary keybindings</figcaption>
</figure>
-<h5 id="layers">Layers<a class="headerlink" href="#layers" title="Permanent link">&para;</a></h5>
-<p>Finally, rename the physics layers so we don&rsquo;t lose track of which layer is which. Go to <em>Project -&gt; Layer Names -&gt; 2d Physics</em> and change the first 5 layer names to (in order): &ldquo;player&rdquo;, &ldquo;ground&rdquo;, &ldquo;pipe&rdquo;, &ldquo;ceiling&rdquo; and &ldquo;score&rdquo;.</p>
+<h4 id="layers">Layers<a class="headerlink" href="#layers" title="Permanent link">&para;</a></h4>
+<p>Finally, rename the physics layers so we don&rsquo;t lose track of which layer is which. Go to <em>Project -&gt; Layer Names -&gt; 2d Physics</em> and change the first 5 layer names to (in order): <code>player</code>, <code>ground</code>, <code>pipe</code>, <code>ceiling</code> and <code>score</code>.</p>
<figure id="__yafg-figure-9">
-<img alt="Project settings - Layer Names - 2D Physics" src="images/g/flappybird_godot/project_settings_layer_names_2d_physics.png" title="Project settings - Layer Names - 2D Physics">
+<img alt="Project settings - Layer Names - 2D Physics" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png" title="Project settings - Layer Names - 2D Physics">
<figcaption>Project settings - Layer Names - 2D Physics</figcaption>
</figure>
-<h3 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h3>
+<h2 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h2>
<p>For the assets I found out about a pack that contains just what I need: <a href="https://megacrash.itch.io/flappy-bird-assets">flappy-bird-assets</a> by <a href="https://megacrash.itch.io/">MegaCrash</a>; I just did some minor modifications on the naming of the files. For the font I used <a href="https://poppyworks.itch.io/silver">Silver</a>, and for the sound the resources from <a href="https://github.com/meeq/FlappyBird-N64">FlappyBird-N64</a> (which seems to be taken from <a href="https://www.101soundboards.com/boards/10178-flappy-bird-sounds">101soundboards.com</a> which the orignal copyright holder is <a href="https://dotgears.com/">.Gears</a> anyways).</p>
-<h4 id="importing">Importing<a class="headerlink" href="#importing" title="Permanent link">&para;</a></h4>
-<p>Create the necessary directories to hold the respective assets and it&rsquo;s just a matter of dragging and dropping, I used directories: <code>res://entities/actors/player/sprites/</code>, <code>res://fonts/</code>, <code>res://levels/world/background/sprites/</code>, <code>res://levels/world/ground/sprites/</code>, <code>res://levels/world/pipe/sprites/</code>, <code>res://sfx/</code>. For the player sprites, the &ldquo;FileSystem&rdquo; window looks like this (<code>entities/actor</code> directories are really not necessary):</p>
+<h3 id="importing">Importing<a class="headerlink" href="#importing" title="Permanent link">&para;</a></h3>
+<p>Create the necessary directories to hold the respective assets and it&rsquo;s just a matter of dragging and dropping, I used directories: <code>res://entities/actors/player/sprites/</code>, <code>res://fonts/</code>, <code>res://levels/world/background/sprites/</code>, <code>res://levels/world/ground/sprites/</code>, <code>res://levels/world/pipe/sprites/</code>, <code>res://sfx/</code>. For the player sprites, the
+<em>FileSystem</em> window looks like this (<code>entities/actor</code> directories are really not necessary):</p>
<figure id="__yafg-figure-10">
-<img alt="FileSystem - Player sprite imports" src="images/g/flappybird_godot/player_sprite_imports.png" title="FileSystem - Player sprite imports">
+<img alt="FileSystem - Player sprite imports" src="https://static.luevano.xyz/images/g/flappybird_godot/player_sprite_imports.png" title="FileSystem - Player sprite imports">
<figcaption>FileSystem - Player sprite imports</figcaption>
</figure>
<p>It should look similar for other directories, except maybe for the file extensions. For example, for the sfx:</p>
<figure id="__yafg-figure-11">
-<img alt="FileSystem - SFX imports" src="images/g/flappybird_godot/sfx_imports.png" title="FileSystem - SFX imports">
+<img alt="FileSystem - SFX imports" src="https://static.luevano.xyz/images/g/flappybird_godot/sfx_imports.png" title="FileSystem - SFX imports">
<figcaption>FileSystem - SFX imports</figcaption>
</figure>
-<h3 id="scenes">Scenes<a class="headerlink" href="#scenes" title="Permanent link">&para;</a></h3>
+<h2 id="scenes">Scenes<a class="headerlink" href="#scenes" title="Permanent link">&para;</a></h2>
<p>Now it&rsquo;s time to actually create the game, by creating the basic scenes that will make up the game. The hardest part and the most confusing is going to be the <em>TileMaps</em>, so that goes first.</p>
-<h4 id="tilemaps">TileMaps<a class="headerlink" href="#tilemaps" title="Permanent link">&para;</a></h4>
-<p>I&rsquo;m using a scene called &ldquo;WorldTiles&rdquo; with a <em>Node2D</em> node as root called the same. With 2 different <em>TileMap</em> nodes as children named &ldquo;GroundTileMap&rdquo; and &ldquo;PipeTileMap&rdquo; (these are their own scene); yes 2 different <em>TileMaps</em> because we need 2 different physics colliders (In Godot 4.0 you can have a single <em>TileMap</em> with different physics colliders in it). Each node has its own script. It should look something like this:</p>
+<h3 id="tilemaps">TileMaps<a class="headerlink" href="#tilemaps" title="Permanent link">&para;</a></h3>
+<p>I&rsquo;m using a scene called <code>WorldTiles</code> with a <em>Node2D</em> node as root called the same. With 2 different <em>TileMap</em> nodes as children named <code>GroundTileMap</code> and <code>PipeTileMap</code> (these are their own scene); yes 2 different <em>TileMaps</em> because we need 2 different physics colliders (in <em>Godot 4.0</em> you can have a single <em>TileMap</em> with different physics colliders in it). Each node has its own script. It should look something like this:</p>
<figure id="__yafg-figure-12">
-<img alt="Scene - WorldTiles (TileMaps)" src="images/g/flappybird_godot/scene_world_tiles.png" title="Scene - WorldTiles (TileMaps)">
+<img alt="Scene - WorldTiles (TileMaps)" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_world_tiles.png" title="Scene - WorldTiles (TileMaps)">
<figcaption>Scene - WorldTiles (TileMaps)</figcaption>
</figure>
<p>I used the following directory structure:</p>
<figure id="__yafg-figure-13">
-<img alt="Scene - WorldTiles - Directory structure" src="images/g/flappybird_godot/scene_world_tiles_directory_structure.png" title="Scene - WorldTiles - Directory structure">
+<img alt="Scene - WorldTiles - Directory structure" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_world_tiles_directory_structure.png" title="Scene - WorldTiles - Directory structure">
<figcaption>Scene - WorldTiles - Directory structure</figcaption>
</figure>
-<p>To configure the GroundTileMap, select the node and click on &ldquo;(empty)&rdquo; on the <em>TileMap/Tile set</em> property and then click on &ldquo;New TileSet&rdquo;, then click where the &ldquo;(empty)&rdquo; used to be, a new window should open on the bottom:</p>
+<p>To configure the <code>GroundTileMap</code>, select the node and click on <code>(empty)</code> on the <em>TileMap/Tile set</em> property and then click on <code>New TileSet</code>, then click where the <code>(empty)</code> used to be, a new window should open on the bottom:</p>
<figure id="__yafg-figure-14">
-<img alt="TileSet - Configuration window" src="images/g/flappybird_godot/tile_set_config_window.png" title="TileSet - Configuration window">
+<img alt="TileSet - Configuration window" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_config_window.png" title="TileSet - Configuration window">
<figcaption>TileSet - Configuration window</figcaption>
</figure>
-<p>Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow &ldquo;+ New Single Tile&rdquo;, activate the grid and select any of the tiles. Should look like this:</p>
+<p>Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow <code>+ New Single Tile</code>, activate the grid and select any of the tiles. Should look like this:</p>
<figure id="__yafg-figure-15">
-<img alt="TileSet - New single tile" src="images/g/flappybird_godot/tile_set_new_single_tile.png" title="TileSet - New single tile">
+<img alt="TileSet - New single tile" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_new_single_tile.png" title="TileSet - New single tile">
<figcaption>TileSet - New single tile</figcaption>
</figure>
-<p>We need to do this because for some reason we can&rsquo;t change the snap options before selecting a tile. After selecting a random tile, set up the <em>Snap Options/Step</em> (in the <em>Inspector</em>) and set it to 16x16 (or if using a different tile set, to it&rsquo;s tile size):</p>
+<p>We need to do this because for some reason we can&rsquo;t change the snap options before selecting a tile. After selecting a random tile, set up the <em>Snap Options/Step</em> (in the <em>Inspector</em>) and set it to <code>16x16</code> (or if using a different tile set, to it&rsquo;s tile size):</p>
<figure id="__yafg-figure-16">
-<img alt="TileSet - Tile - Step snap options" src="images/g/flappybird_godot/tile_set_tile_step_snap_options.png" title="TileSet - Tile - Step snap options">
+<img alt="TileSet - Tile - Step snap options" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_tile_step_snap_options.png" title="TileSet - Tile - Step snap options">
<figcaption>TileSet - Tile - Step snap options</figcaption>
</figure>
-<p>Now you can select the actual single tile. Once selected click on &ldquo;Collision&rdquo;, use the rectangle tool and draw the rectangle corresponding to that tile&rsquo;s collision:</p>
+<p>Now you can select the actual single tile. Once selected click on <code>Collision</code>, use the rectangle tool and draw the rectangle corresponding to that tile&rsquo;s collision:</p>
<figure id="__yafg-figure-17">
-<img alt="TileSet - Tile - Selection and collision" src="images/g/flappybird_godot/tile_set_tile_selection_collision.png" title="TileSet - Tile - Selection and collision">
+<img alt="TileSet - Tile - Selection and collision" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_tile_selection_collision.png" title="TileSet - Tile - Selection and collision">
<figcaption>TileSet - Tile - Selection and collision</figcaption>
</figure>
<p>Do the same for the other 3 tiles. If you select the <em>TileMap</em> itself again, it should look like this on the right (on default layout it&rsquo;s on the left of the <em>Inspector</em>):</p>
<figure id="__yafg-figure-18">
-<img alt="TileSet - Available tiles" src="images/g/flappybird_godot/tile_set_available_tiles.png" title="TileSet - Available tiles">
+<img alt="TileSet - Available tiles" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_available_tiles.png" title="TileSet - Available tiles">
<figcaption>TileSet - Available tiles</figcaption>
</figure>
<p>The ordering is important only for the &ldquo;underground tile&rdquo;, which is the filler ground, it should be at the end (index 3); if this is not the case, repeat the process (it&rsquo;s possible to rearrange them but it&rsquo;s hard to explain as it&rsquo;s pretty weird).</p>
-<p>At this point the tilemap doesn&rsquo;t have any physics and the cell size is wrong. Select the &ldquo;GroundTileMap&rdquo;, set the <em>TileMap/Cell/Size</em> to 16x16, the <em>TileMap/Collision/Layer</em> set to <code>bit 2</code> only (ground layer) and disable any <em>TileMap/Collision/Mask</em> bits. Should look something like this:</p>
+<p>At this point the tilemap doesn&rsquo;t have any physics and the cell size is wrong. Select the <code>GroundTileMap</code>, set the <em>TileMap/Cell/Size</em> to <code>16x16</code>, the <em>TileMap/Collision/Layer</em> set to <code>bit 2</code> only (ground layer) and disable any <em>TileMap/Collision/Mask</em> bits. Should look something like this:</p>
<figure id="__yafg-figure-19">
-<img alt="TileMap - Cell size and collision configuration" src="images/g/flappybird_godot/tile_map_cell_collision_configuration.png" title="TileMap - Cell size and collision configuration">
+<img alt="TileMap - Cell size and collision configuration" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_map_cell_collision_configuration.png" title="TileMap - Cell size and collision configuration">
<figcaption>TileMap - Cell size and collision configuration</figcaption>
</figure>
-<p>Now it&rsquo;s just a matter of repeating the same for the pipes (&ldquo;PipeTileMap&rdquo;), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the <em>Snap Options/Step</em> to 32x16, for example, just keep the cell size to 16x16.</p>
-<h5 id="default-ground-tiles">Default ground tiles<a class="headerlink" href="#default-ground-tiles" title="Permanent link">&para;</a></h5>
-<p>I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the &ldquo;WorldTiles&rdquo; scene, while selecting the &ldquo;GroundTileMap&rdquo;, you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from <code>(-8, 7)</code> to <code>(10, 7)</code> as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):</p>
+<p>Now it&rsquo;s just a matter of repeating the same for the pipes (<code>PipeTileMap</code>), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the <em>Snap Options/Step</em> to <code>32x16</code>, for example, just keep the cell size to <code>16x16</code>.</p>
+<h4 id="default-ground-tiles">Default ground tiles<a class="headerlink" href="#default-ground-tiles" title="Permanent link">&para;</a></h4>
+<p>I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the <code>WorldTiles</code> scene, while selecting the <code>GroundTileMap</code>, you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from <code>(-8, 7)</code> to <code>(10, 7)</code> as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):</p>
<figure id="__yafg-figure-20">
-<img alt="Scene - WorldTiles - Default ground tiles" src="images/g/flappybird_godot/world_tiles_default_tiles.png" title="Scene - WorldTiles - Default ground tiles">
+<img alt="Scene - WorldTiles - Default ground tiles" src="https://static.luevano.xyz/images/g/flappybird_godot/world_tiles_default_tiles.png" title="Scene - WorldTiles - Default ground tiles">
<figcaption>Scene - WorldTiles - Default ground tiles</figcaption>
</figure>
-<h4 id="player">Player<a class="headerlink" href="#player" title="Permanent link">&para;</a></h4>
-<p>On a new scene called &ldquo;Player&rdquo; with a <em>KinematicBody2D</em> node named &ldquo;Player&rdquo; as the root of the scene, then for the children: <em>AnimatedSprite</em> as &ldquo;Sprite&rdquo;, <em>CollisionShape2D</em> as &ldquo;Collision&rdquo; (with a circle shape) and 3 <em>AudioStreamPlayers</em> for &ldquo;JumpSound&rdquo;, &ldquo;DeadSound&rdquo; and &ldquo;HitSound&rdquo;. Not sure if it&rsquo;s a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the &ldquo;Player&rdquo; node and then it should look like this:</p>
+<h3 id="player">Player<a class="headerlink" href="#player" title="Permanent link">&para;</a></h3>
+<p>On a new scene called <code>Player</code> with a <em>KinematicBody2D</em> node named <code>Player</code> as the root of the scene, then for the children: <em>AnimatedSprite</em> as <code>Sprite</code>, <em>CollisionShape2D</em> as <code>Collision</code> (with a circle shape) and 3 <em>AudioStreamPlayers</em> for <code>JumpSound</code>, <code>DeadSound</code> and <code>HitSound</code>. Not sure if it&rsquo;s a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the <code>Player</code> node and then it should look like this:</p>
<figure id="__yafg-figure-21">
-<img alt="Scene - Player - Node setup" src="images/g/flappybird_godot/scene_player_node_setup.png" title="Scene - Player - Node setup">
+<img alt="Scene - Player - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_node_setup.png" title="Scene - Player - Node setup">
<figcaption>Scene - Player - Node setup</figcaption>
</figure>
-<p>Select the &ldquo;Player&rdquo; node and set the <em>CollisionShape2D/Collision/Layer</em> to 1 and the <em>CollisionObject2D/Collision/Mask</em> to 2 and 3 (ground and pipe).</p>
-<p>For the &ldquo;Sprite&rdquo; node, when selecting it click on the &ldquo;(empty)&rdquo; for the <em>AnimatedSprite/Frames</em> property and click &ldquo;New SpriteFrames&rdquo;, click again where the &ldquo;(empty)&rdquo; used to be and ane window should open on the bottom:</p>
+<p>Select the <code>Player</code> node and set the <em>CollisionShape2D/Collision/Layer</em> to <code>1</code> and the <em>CollisionObject2D/Collision/Mask</em> to <code>2</code> and <code>3</code> (ground and pipe).</p>
+<p>For the <code>Sprite</code> node, when selecting it click on the <code>(empty)</code> for the <em>AnimatedSprite/Frames</em> property and click <code>New SpriteFrames</code>, click again where the <code>(empty)</code> used to be and ane window should open on the bottom:</p>
<figure id="__yafg-figure-22">
-<img alt="Scene - Player - SpriteFrames window" src="images/g/flappybird_godot/scene_player_spriteframes_window.png" title="Scene - Player - SpriteFrames window">
+<img alt="Scene - Player - SpriteFrames window" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_spriteframes_window.png" title="Scene - Player - SpriteFrames window">
<figcaption>Scene - Player - SpriteFrames window</figcaption>
</figure>
-<p>Right off the bat, set the &ldquo;Speed&rdquo; to <code>10 FPS</code> (bottom left) and rename &ldquo;default&rdquo; to &ldquo;bird_1&rdquo;. With the &ldquo;bird_1&rdquo; selected, click on the &ldquo;Add frames from a Sprite Sheet&rdquo;, which is the second button under &ldquo;Animation Frames:&rdquo; which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the &ldquo;Select Frames&rdquo; window, change the &ldquo;Vertical&rdquo; to 1, and then select all 4 frames (<em>Ctrl + Scroll</em> wheel to zoom in):</p>
+<p>Right off the bat, set the <code>Speed</code> to <code>10 FPS</code> (bottom left) and rename <code>default</code> to <code>bird_1</code>. With the <code>bird_1</code> selected, click on the <code>Add frames from a Sprite Sheet</code>, which is the second button under <code>Animation Frames:</code> which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the <code>Select Frames</code> window, change the <code>Vertical</code> to <code>1</code>, and then select all 4 frames (<em>Ctrl + Scroll</em> wheel to zoom in):</p>
<figure id="__yafg-figure-23">
-<img alt="Scene - Player - Sprite sheet importer" src="images/g/flappybird_godot/scene_player_sprite_sheet_importer.png" title="Scene - Player - Sprite sheet importer">
+<img alt="Scene - Player - Sprite sheet importer" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png" title="Scene - Player - Sprite sheet importer">
<figcaption>Scene - Player - Sprite sheet importer</figcaption>
</figure>
<p>After that, the <em>SpriteFrames</em> window should look like this:</p>
<figure id="__yafg-figure-24">
-<img alt="Scene - Player - SpriteFrames window with sprite sheet configured" src="images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png" title="Scene - Player - SpriteFrames window with sprite sheet configured">
+<img alt="Scene - Player - SpriteFrames window with sprite sheet configured" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png" title="Scene - Player - SpriteFrames window with sprite sheet configured">
<figcaption>Scene - Player - SpriteFrames window with sprite sheet configured</figcaption>
</figure>
-<p>Finally, make sure the &ldquo;Sprite&rdquo; node has the <em>AnimatedSprite/Animation</em> is set to &ldquo;bird_1&rdquo; and that the &ldquo;Collision&rdquo; node is configured correctly for its size and position (I just have it as a radius of 7). As well as dropping the SFX files into the corresponding <em>AudioStreamPlayer</em> (into the <em>AudioStreamPlayer/Stream</em> property).</p>
-<h4 id="other">Other<a class="headerlink" href="#other" title="Permanent link">&para;</a></h4>
+<p>Finally, make sure the <code>Sprite</code> node has the <em>AnimatedSprite/Animation</em> is set to <code>bird_1</code> and that the <code>Collision</code> node is configured correctly for its size and position (I just have it as a radius of <code>7</code>). As well as dropping the SFX files into the corresponding <em>AudioStreamPlayer</em> (into the <em>AudioStreamPlayer/Stream</em> property).</p>
+<h3 id="other">Other<a class="headerlink" href="#other" title="Permanent link">&para;</a></h3>
<p>These are really simple scenes that don&rsquo;t require much setup:</p>
<ul>
-<li>&ldquo;CeilingDetector&rdquo;: just an <em>Area2D</em> node with a <em>CollisionShape2D</em> in the form of a rectangle (<em>CollisionShape2D/Shape/extents</em> to <code>(120, 10)</code>), stretched horizontally so it fits the whole screen. <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 4</code> (ceiling) and <em>CollisionObject2D/Collision/Mask</em> set to bit 1 (player).</li>
-<li>&ldquo;ScoreDetector&rdquo;: similar to the &ldquo;CeilingDetector&rdquo;, but vertical (<em>CollisionShape2D/Shape/extents</em> to <code>(2.5, 128)</code>) and <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 1</code> (player).</li>
-<li>&ldquo;WorldDetector&rdquo;: <em>Node2D</em> with a script attached, and 3 <em>RayCast2D</em> as children:<ul>
-<li>&ldquo;NewTile&rdquo;: <em>Raycast2D/Enabled</em> to true (checked), <em>Raycast2D/Cast To</em> <code>(0, 400)</code>, <em>Raycast2D/Collision Mask</em> to <code>bit 2</code> (ground) and <em>Node2D/Transform/Position</em> to <code>(152, -200)</code></li>
-<li>&ldquo;OldTile&rdquo;: same as &ldquo;NewTile&rdquo;, except for the <em>Node2D/Transform/Position</em>, set it to <code>(-152, -200)</code>.</li>
-<li>&ldquo;OldPipe&rdquo;: same as &ldquo;OldTile&rdquo;, except for the <em>Raycast2D/Collision Mask</em>, set it to <code>bit 3</code> (pipe).</li>
+<li><code>CeilingDetector</code>: just an <em>Area2D</em> node with a <em>CollisionShape2D</em> in the form of a rectangle (<em>CollisionShape2D/Shape/extents</em> to <code>(120, 10)</code>), stretched horizontally so it fits the whole screen. <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 4</code> (ceiling) and <em>CollisionObject2D/Collision/Mask</em> set to <code>bit 1</code> (player).</li>
+<li><code>ScoreDetector</code>: similar to the <code>CeilingDetector</code>, but vertical (<em>CollisionShape2D/Shape/extents</em> to <code>(2.5, 128)</code>) and <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 1</code> (player).</li>
+<li><code>WorldDetector</code>: <em>Node2D</em> with a script attached, and 3 <em>RayCast2D</em> as children:<ul>
+<li><code>NewTile</code>: <em>Raycast2D/Enabled</em> to true (checked), <em>Raycast2D/Cast To</em> <code>(0, 400)</code>, <em>Raycast2D/Collision Mask</em> to <code>bit 2</code> (ground) and <em>Node2D/Transform/Position</em> to <code>(152, -200)</code></li>
+<li><code>OldTile</code>: same as &ldquo;NewTile&rdquo;, except for the <em>Node2D/Transform/Position</em>, set it to <code>(-152, -200)</code>.</li>
+<li><code>OldPipe</code>: same as &ldquo;OldTile&rdquo;, except for the <em>Raycast2D/Collision Mask</em>, set it to <code>bit 3</code> (pipe).</li>
</ul>
</li>
</ul>
-<h4 id="game">Game<a class="headerlink" href="#game" title="Permanent link">&para;</a></h4>
-<p>This is the actual &ldquo;Game&rdquo; scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a <em>Node2D</em> and also has an attached script. Also need to add 2 additional <em>AudioStreamPlayers</em> for the &ldquo;start&rdquo; and &ldquo;score&rdquo; sounds, as well as a <em>Sprite</em> for the background (<em>Sprite/Offset/Offset</em> set to <code>(0, 10)</code>) and a <em>Camera2D</em> (<em>Camera2D/Current</em> set to true (checked)). It should look something like this:</p>
+<h3 id="game">Game<a class="headerlink" href="#game" title="Permanent link">&para;</a></h3>
+<p>This is the actual <code>Game</code> scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a <em>Node2D</em> and also has an attached script. Also need to add 2 additional <em>AudioStreamPlayers</em> for the &ldquo;start&rdquo; and &ldquo;score&rdquo; sounds, as well as a <em>Sprite</em> for the background (<em>Sprite/Offset/Offset</em> set to <code>(0, 10)</code>) and a <em>Camera2D</em> (<em>Camera2D/Current</em> set to true (checked)). It should look something like this:</p>
<figure id="__yafg-figure-25">
-<img alt="Scene - Game - Node setup" src="images/g/flappybird_godot/scene_game_node_setup.png" title="Scene - Game - Node setup">
+<img alt="Scene - Game - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_game_node_setup.png" title="Scene - Game - Node setup">
<figcaption>Scene - Game - Node setup</figcaption>
</figure>
<p>The scene viewport should look something like the following:</p>
<figure id="__yafg-figure-26">
-<img alt="Scene - Game - Viewport" src="images/g/flappybird_godot/scene_game_viewport.png" title="Scene - Game - Viewport">
+<img alt="Scene - Game - Viewport" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_game_viewport.png" title="Scene - Game - Viewport">
<figcaption>Scene - Game - Viewport</figcaption>
</figure>
-<h4 id="ui">UI<a class="headerlink" href="#ui" title="Permanent link">&para;</a></h4>
-<h5 id="fonts">Fonts<a class="headerlink" href="#fonts" title="Permanent link">&para;</a></h5>
-<p>We need some font &ldquo;Resources&rdquo; to style the <em>Label</em> fonts. Under the <em>FileSystem</em> window, right click on the fonts directory (create one if needed) and click on &ldquo;New Resource&hellip;&rdquo; and select <em>DynamicFontData</em>, save it in the &ldquo;fonts&rdquo; directory as &ldquo;SilverDynamicFontData.tres&rdquo; (&ldquo;Silver&rdquo; as it is the font I&rsquo;m using) then double click the just created resource and set the <em>DynamicFontData/Font Path</em> to the actual &ldquo;Silver.ttf&rdquo; font (or whatever you want).</p>
-<p>Then create a new resource and this time select <em>DynamicFont</em>, name it &ldquo;SilverDynamicFont.tres&rdquo;, then double click to edit and add the &ldquo;SilverDynamicFontData.tres&rdquo; to the <em>DynamicFont/Font/Font Data</em> property (and I personally toggled off the <em>DynamicFont/Font/Antialiased</em> property), now just set the <em>DynamicFont/Settings/(Size, Outline Size, Outline Color)</em> to 32, 1 and black, respectively (or any other values you want). It should look something like this:</p>
+<h3 id="ui">UI<a class="headerlink" href="#ui" title="Permanent link">&para;</a></h3>
+<h4 id="fonts">Fonts<a class="headerlink" href="#fonts" title="Permanent link">&para;</a></h4>
+<p>We need some font <code>Resources</code> to style the <em>Label</em> fonts. Under the <em>FileSystem</em> window, right click on the fonts directory (create one if needed) and click on <code>New Resource...</code> and select <em>DynamicFontData</em>, save it in the &ldquo;fonts&rdquo; directory as <code>SilverDynamicFontData.tres</code> (<code>Silver</code> as it is the font I&rsquo;m using) then double click the just created resource and set the <em>DynamicFontData/Font Path</em> to the actual <code>Silver.ttf</code> font (or whatever you want).</p>
+<p>Then create a new resource and this time select <em>DynamicFont</em>, name it <code>SilverDynamicFont.tres</code>, then double click to edit and add the <code>SilverDynamicFontData.tres</code> to the <em>DynamicFont/Font/Font Data</em> property (and I personally toggled off the <em>DynamicFont/Font/Antialiased</em> property), now just set the <em>DynamicFont/Settings/(Size, Outline Size, Outline Color)</em> to <code>32</code>, <code>1</code> and <code>black</code>, respectively (or any other values you want). It should look something like this:</p>
<figure id="__yafg-figure-27">
-<img alt="Resource - DynamicFont - Default font" src="images/g/flappybird_godot/resource_dynamic_font.png" title="Resource - DynamicFont - Default font">
+<img alt="Resource - DynamicFont - Default font" src="https://static.luevano.xyz/images/g/flappybird_godot/resource_dynamic_font.png" title="Resource - DynamicFont - Default font">
<figcaption>Resource - DynamicFont - Default font</figcaption>
</figure>
-<p>Do the same for another <em>DynamicFont</em> which will be used for the score label, named &ldquo;SilverScoreDynamicFont.tres&rdquo;. Only changes are <em>Dynamic/Settings/(Size, Outline Size)</em> which are set to 128 and 2, respectively. The final files for the fonts should look something like this:</p>
+<p>Do the same for another <em>DynamicFont</em> which will be used for the score label, named <code>SilverScoreDynamicFont.tres</code>. Only changes are <em>Dynamic/Settings/(Size, Outline Size)</em> which are set to <code>128</code> and <code>2</code>, respectively. The final files for the fonts should look something like this:</p>
<figure id="__yafg-figure-28">
-<img alt="Resource - Dynamicfont - Directory structure" src="images/g/flappybird_godot/resource_dynamic_font_directory_structure.png" title="Resource - Dynamicfont - Directory structure">
+<img alt="Resource - Dynamicfont - Directory structure" src="https://static.luevano.xyz/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png" title="Resource - Dynamicfont - Directory structure">
<figcaption>Resource - Dynamicfont - Directory structure</figcaption>
</figure>
-<h5 id="scene-setup">Scene setup<a class="headerlink" href="#scene-setup" title="Permanent link">&para;</a></h5>
-<p>This has a bunch of nested nodes, so I&rsquo;ll try to be concise here. The root node is a <em>CanvasLayer</em> named &ldquo;UI&rdquo; with its own script attached, and for the children:</p>
+<h4 id="scene-setup">Scene setup<a class="headerlink" href="#scene-setup" title="Permanent link">&para;</a></h4>
+<p>This has a bunch of nested nodes, so I&rsquo;ll try to be concise here. The root node is a <em>CanvasLayer</em> named <code>UI</code> with its own script attached, and for the children:</p>
<ul>
-<li>&ldquo;MarginContainer&rdquo;: <em>MarginContainer</em> with <em>Control/Margin/(Left, Top)</em> set to <code>10</code> and <em>Control/Margin/(Right, Bottom)</em> set to <code>-10</code>.<ul>
-<li>&ldquo;InfoContainer&rdquo;: <em>VBoxContainer</em> with <em>Control/Theme Overrides/Constants/Separation</em> set to <code>250</code>.<ul>
-<li>&ldquo;ScoreContainer&rdquo;: <em>VBoxContainer</em>.<ul>
-<li>&ldquo;Score&rdquo;: <em>Label</em> with <em>Label/Align</em> set to &ldquo;Center&rdquo;, <em>Control/Theme Overrides/Fonts/Font</em> to the &ldquo;SilverScoreDynamicFont.tres&rdquo;, if needed adjust the <em>DynamicFont</em> settings.</li>
-<li>&ldquo;HighScore: same as &ldquo;Score&rdquo;, escept for the <em>Control/Theme Overrides/Fonts/Font</em> which is set to &ldquo;SilverDynamicFont.tres&rdquo;.</li>
+<li><code>MarginContainer</code>: <em>MarginContainer</em> with <em>Control/Margin/(Left, Top)</em> set to <code>10</code> and <em>Control/Margin/(Right, Bottom)</em> set to <code>-10</code>.<ul>
+<li><code>InfoContainer</code>: <em>VBoxContainer</em> with <em>Control/Theme Overrides/Constants/Separation</em> set to <code>250</code>.<ul>
+<li><code>ScoreContainer</code>: <em>VBoxContainer</em>.<ul>
+<li><code>Score</code>: <em>Label</em> with <em>Label/Align</em> set to <code>Center</code>, <em>Control/Theme Overrides/Fonts/Font</em> to the <code>SilverScoreDynamicFont.tres</code>, if needed adjust the <em>DynamicFont</em> settings.</li>
+<li><code>HighScore</code>: same as <code>Score</code>, escept for the <em>Control/Theme Overrides/Fonts/Font</em> which is set to <code>SilverDynamicFont.tres</code>.</li>
</ul>
</li>
-<li>&ldquo;StartGame&rdquo;: Same as &ldquo;HighScore&rdquo;.</li>
+<li><code>StartGame</code>: Same as <code>HighScore</code>.</li>
</ul>
</li>
-<li>&ldquo;DebugContainer&rdquo;: <em>VBoxContainer</em>.<ul>
-<li>&ldquo;FPS&rdquo;: <em>Label</em>.</li>
+<li><code>DebugContainer</code>: <em>VBoxContainer</em>.<ul>
+<li><code>FPS</code>: <em>Label</em>.</li>
</ul>
</li>
-<li>&ldquo;VersionContainer&rdquo;: <em>VBoxContainer</em> with <em>BoxContainer/Alignment</em> set to &ldquo;Begin&rdquo;.<ul>
-<li>&ldquo;Version&rdquo;: <em>Label</em> with <em>Label/Align</em> set to &ldquo;Right&rdquo;.</li>
+<li><code>VersionContainer</code>: <em>VBoxContainer</em> with <em>BoxContainer/Alignment</em> set to <code>Begin</code>.<ul>
+<li><code>Version</code>: <em>Label</em> with <em>Label/Align</em> set to <code>Right</code>.</li>
</ul>
</li>
</ul>
@@ -275,17 +345,17 @@
</ul>
<p>The scene ends up looking like this:</p>
<figure id="__yafg-figure-29">
-<img alt="Scene - UI - Node setup" src="images/g/flappybird_godot/scene_ui.png" title="Scene - UI - Node setup">
+<img alt="Scene - UI - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_ui.png" title="Scene - UI - Node setup">
<figcaption>Scene - UI - Node setup</figcaption>
</figure>
-<h4 id="main">Main<a class="headerlink" href="#main" title="Permanent link">&para;</a></h4>
-<p>This is the final scene where we connect the Game and the UI. It&rsquo;s made of a <em>Node2D</em> with it&rsquo;s own script attached and an instance of &ldquo;Game&rdquo; and &ldquo;UI&rdquo; as it&rsquo;s children.</p>
-<p>This is a good time to set the default scene when we run the game by going to <em>Project -&gt; Project settings&hellip; -&gt; General</em> and in <em>Application/Run</em> set the <em>Main Scene</em> to the &ldquo;Main.tscn&rdquo; scene.</p>
-<h3 id="scripting">Scripting<a class="headerlink" href="#scripting" title="Permanent link">&para;</a></h3>
+<h3 id="main">Main<a class="headerlink" href="#main" title="Permanent link">&para;</a></h3>
+<p>This is the final scene where we connect the <code>Game</code> and the <code>UI</code>. It&rsquo;s made of a <em>Node2D</em> with it&rsquo;s own script attached and an instance of <code>Game</code> and <code>UI</code> as it&rsquo;s children.</p>
+<p>This is a good time to set the default scene when we run the game by going to <em>Project -&gt; Project settings&hellip; -&gt; General</em> and in <em>Application/Run</em> set the <em>Main Scene</em> to the <code>Main.tscn</code> scene.</p>
+<h2 id="scripting">Scripting<a class="headerlink" href="#scripting" title="Permanent link">&para;</a></h2>
<p>I&rsquo;m going to keep this scripting part to the most basic code blocks, as it&rsquo;s too much code, for a complete view you can head to the <a href="https://github.com/luevano/flappybird_godot">source code</a>.</p>
<p>As of now, the game itself doesn&rsquo;t do anything if we hit play. The first thing to do so we have something going on is to do the minimal player scripting.</p>
-<h4 id="player_1">Player<a class="headerlink" href="#player_1" title="Permanent link">&para;</a></h4>
-<p>The most basic code needed so the bird goes up and down is to just detect &ldquo;jump&rdquo; key presses and add a negative jump velocity so it goes up (<code>y</code> coordinate is reversed in godot&hellip;), we also check the velocity sign of the <code>y</code> coordinate to decide if the animation is playing or not.</p>
+<h3 id="player_1">Player<a class="headerlink" href="#player_1" title="Permanent link">&para;</a></h3>
+<p>The most basic code needed so the bird goes up and down is to just detect <code>jump</code> key presses and add a negative jump velocity so it goes up (<code>y</code> coordinate is reversed in godot&hellip;), we also check the velocity sign of the <code>y</code> coordinate to decide if the animation is playing or not.</p>
<pre><code class="language-gdscript">class_name Player
extends KinematicBody2D
@@ -334,7 +404,7 @@ func _physics_process(delta: float) -&gt; void:
dead_sound.play()
</code></pre>
<p>Finally need to add the actual checks for when the player dies (like collision with ground or pipe) as well as a function that listens to a signal for when the player goes to the ceiling.</p>
-<h4 id="worlddetector">WorldDetector<a class="headerlink" href="#worlddetector" title="Permanent link">&para;</a></h4>
+<h3 id="worlddetector">WorldDetector<a class="headerlink" href="#worlddetector" title="Permanent link">&para;</a></h3>
<p>The code is pretty simple, we just need a way of detecting if we ran out of ground and send a signal, as well as sending as signal when we start detecting ground/pipes behind us (to remove it) because the world is being generated as we move. The most basic functions needed are:</p>
<pre><code class="language-gdscript">func _was_colliding(detector: RayCast2D, flag: bool, signal_name: String) -&gt; bool:
if detector.is_colliding():
@@ -353,8 +423,8 @@ func _now_colliding(detector: RayCast2D, flag: bool, signal_name: String) -&gt;
return false
</code></pre>
<p>We need to keep track of 3 &ldquo;flags&rdquo;: <code>ground_was_colliding</code>, <code>ground_now_colliding</code> and <code>pipe_now_colliding</code> (and their respective signals), which are going to be used to do the checks inside <code>_physics_process</code>. For example for checking for new ground: <code>ground_now_colliding = _now_colliding(old_ground, ground_now_colliding, "ground_started_colliding")</code>.</p>
-<h4 id="worldtiles">WorldTiles<a class="headerlink" href="#worldtiles" title="Permanent link">&para;</a></h4>
-<p>This script is what handles the &ldquo;GroundTileMap&rdquo; as well as the &ldquo;PipeTileMap&rdquo; and just basically functions as a &ldquo;Signal bus&rdquo; connecting a bunch of signals from the &ldquo;WorldDetector&rdquo; with the <em>TileMaps</em> and just tracking how many pipes have been placed:</p>
+<h3 id="worldtiles">WorldTiles<a class="headerlink" href="#worldtiles" title="Permanent link">&para;</a></h3>
+<p>This script is what handles the <code>GroundTileMap</code> as well as the <code>PipeTileMap</code> and just basically functions as a &ldquo;Signal bus&rdquo; connecting a bunch of signals from the <code>WorldDetector</code> with the <em>TileMaps</em> and just tracking how many pipes have been placed:</p>
<pre><code class="language-gdscript">export(int, 2, 20, 2) var PIPE_SEP: int = 6
var tiles_since_last_pipe: int = PIPE_SEP - 1
@@ -375,7 +445,7 @@ func _on_WorldDetector_ground_started_colliding() -&gt; void:
func _on_WorldDetector_pipe_started_colliding() -&gt; void:
emit_signal(&quot;remove_pipe&quot;)
</code></pre>
-<h5 id="groundtilemap">GroundTileMap<a class="headerlink" href="#groundtilemap" title="Permanent link">&para;</a></h5>
+<h4 id="groundtilemap">GroundTileMap<a class="headerlink" href="#groundtilemap" title="Permanent link">&para;</a></h4>
<p>This is the node that actually places the ground tiles upong receiving a signal. In general, what you want is to keep track of the newest tile that you need to place (empty spot) as well as the last tile that is in the tilemap (technically the first one if you count from left to right). I was experimenting with <code>enum</code>s so I used them to define the possible <code>Ground</code> tiles:</p>
<pre><code class="language-gdscript">enum Ground {
TILE_1,
@@ -406,10 +476,10 @@ func _remove_first_ground() -&gt; void:
old_tile_position += Vector2.RIGHT
</code></pre>
<p>Where you might notice that the <code>_initial_new_tile_x</code> is <code>11</code>, instead of <code>10</code>, refer to <a href="#default-ground-tiles">Default ground tiles</a> where we placed tiles from <code>-8</code> to <code>10</code>, so the next empty one is <code>11</code>. These <code>_place_new_ground</code> and <code>_remove_first_ground</code> functions are called upon receiving the signal.</p>
-<h5 id="pipetilemap">PipeTileMap<a class="headerlink" href="#pipetilemap" title="Permanent link">&para;</a></h5>
-<p>This is really similar to the &ldquo;GroundTileMap&rdquo; code, instead of defining an <code>enum</code> for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):</p>
+<h4 id="pipetilemap">PipeTileMap<a class="headerlink" href="#pipetilemap" title="Permanent link">&para;</a></h4>
+<p>This is really similar to the <code>GroundTileMap</code> code, instead of defining an <code>enum</code> for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):</p>
<figure id="__yafg-figure-30">
-<img alt="PipeTileMap - Tile set indexes" src="images/g/flappybird_godot/tile_set_pipes_indexes.png" title="PipeTileMap - Tile set indexes">
+<img alt="PipeTileMap - Tile set indexes" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_pipes_indexes.png" title="PipeTileMap - Tile set indexes">
<figcaption>PipeTileMap - Tile set indexes</figcaption>
</figure>
<p>Then you can use the following &ldquo;pipe patterns&rdquo;:</p>
@@ -422,7 +492,7 @@ func _remove_first_ground() -&gt; void:
PipePattern.PIPE_6: [0, 1, 2, 3, 4, -1, -1, -1, 0, 1, 2, 2, 2, 2, 2, 2]
}
</code></pre>
-<p>Now, the pipe system requires a bit more of tracking as we need to instantiate a &ldquo;ScoreDetector&rdquo; here, too. I ended up keeping track of the placed pipes/detectors by using a &ldquo;pipe stack&rdquo; (and &ldquo;detector stack&rdquo;) which is just an array of placed objects from which I pop the first when deleting them:</p>
+<p>Now, the pipe system requires a bit more of tracking as we need to instantiate a <code>ScoreDetector</code> here, too. I ended up keeping track of the placed pipes/detectors by using a &ldquo;pipe stack&rdquo; (and &ldquo;detector stack&rdquo;) which is just an array of placed objects from which I pop the first when deleting them:</p>
<pre><code class="language-gdscript">onready var _pipe_sep: int = get_parent().PIPE_SEP
const _pipe_size: int = 16
const _ground_level: int = 7
@@ -438,7 +508,7 @@ var detector_scene: PackedScene = preload(&quot;res://levels/detectors/score_det
var detector_offset: Vector2 = Vector2(16.0, -(_pipe_size / 2.0) * 16.0)
var detector_stack: Array
</code></pre>
-<p>The <code>detector_offset</code> is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new &ldquo;ScoreDetector&rdquo; (<code>detector_scene</code>) and set it&rsquo;s position to the pipe starting position plus the offset, so it&rsquo;s centered in the pipe, then just need to connect the &ldquo;body_entered&rdquo; signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:</p>
+<p>The <code>detector_offset</code> is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new <code>ScoreDetector</code> (<code>detector_scene</code>) and set it&rsquo;s position to the pipe starting position plus the offset, so it&rsquo;s centered in the pipe, then just need to connect the <code>body_entered</code> signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:</p>
<pre><code class="language-gdscript">func _place_new_pipe() -&gt; void:
var current_pipe: Vector2 = new_pipe_starting_position
for tile in pipe[_get_random_pipe()]:
@@ -468,8 +538,8 @@ var detector_stack: Array
detector.queue_free()
</code></pre>
<p>These functions are called when receiving the signal to place/remove pipes.</p>
-<h4 id="saved-data">Saved data<a class="headerlink" href="#saved-data" title="Permanent link">&para;</a></h4>
-<p>Before proceeding, we require a way to save/load data (for the high scores). We&rsquo;re going to use the <em>ConfigFile</em> node that uses a custom version of the &ldquo;ini&rdquo; file format. Need to define where to save the data:</p>
+<h3 id="saved-data">Saved data<a class="headerlink" href="#saved-data" title="Permanent link">&para;</a></h3>
+<p>Before proceeding, we require a way to save/load data (for the high scores). We&rsquo;re going to use the <em>ConfigFile</em> node that uses a custom version of the <code>ini</code> file format. Need to define where to save the data:</p>
<pre><code class="language-gdscript">const DATA_PATH: String = &quot;user://data.cfg&quot;
const SCORE_SECTION: String = &quot;score&quot;
var _data: ConfigFile
@@ -509,12 +579,12 @@ func get_high_score() -&gt; int:
set_new_high_score(0)
save_data()
</code></pre>
-<p>Now, this script in particular will need to be a <a href="https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html">Singleton (AutoLoad)</a>, which means that there will be only one instance and will be available across all scripts. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; AutoLoad</em> and select this script in the &ldquo;Path:&rdquo; and add a &ldquo;Node Name:&rdquo; (I used &ldquo;SavedData&rdquo;, if you use something else, be careful while following this devlog) which will be the name we&rsquo;ll use to access the singleton. Toggle on &ldquo;Enable&rdquo; if needed, it should look like this:</p>
+<p>Now, this script in particular will need to be a <a href="https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html">Singleton (AutoLoad)</a>, which means that there will be only one instance and will be available across all scripts. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; AutoLoad</em> and select this script in the <code>Path:</code> and add a <code>Node Name:</code> (I used <code>SavedData</code>, if you use something else, be careful while following this devlog) which will be the name we&rsquo;ll use to access the singleton. Toggle on <code>Enable</code> if needed, it should look like this:</p>
<figure id="__yafg-figure-31">
-<img alt="Project settings - AutoLoad - SavedData singleton" src="images/g/flappybird_godot/project_settings_autoload_saved_data.png" title="Project settings - AutoLoad - SavedData singleton">
+<img alt="Project settings - AutoLoad - SavedData singleton" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_autoload_saved_data.png" title="Project settings - AutoLoad - SavedData singleton">
<figcaption>Project settings - AutoLoad - SavedData singleton</figcaption>
</figure>
-<h4 id="game_1">Game<a class="headerlink" href="#game_1" title="Permanent link">&para;</a></h4>
+<h3 id="game_1">Game<a class="headerlink" href="#game_1" title="Permanent link">&para;</a></h3>
<p>The game script it&rsquo;s also like a &ldquo;Signal bus&rdquo; in the sense that it connects all its childs&rsquo; signals together, and also has the job of starting/stopping the <code>_process</code> and <code>_physics_process</code> methods from the childs as needed. First, we need to define the signals and and references to all child nodes:</p>
<pre><code class="language-gdscript">signal game_started
signal game_over
@@ -529,7 +599,7 @@ onready var camera: Camera2D = $Camera
onready var start_sound: AudioStreamPlayer = $StartSound
onready var score_sound: AudioStreamPlayer = $ScoreSound
</code></pre>
-<p>It&rsquo;s important to get the actual &ldquo;player speed&rdquo;, as we&rsquo;re using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the &ldquo;game_scale&rdquo; we setup at the beginning and compute the <code>player_speed</code>:</p>
+<p>It&rsquo;s important to get the actual &ldquo;player speed&rdquo;, as we&rsquo;re using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the <code>game_scale</code> we setup at the beginning and compute the <code>player_speed</code>:</p>
<pre><code class="language-gdscript">var _game_scale: float = ProjectSettings.get_setting(&quot;application/config/game_scale&quot;)
var player_speed: float
@@ -539,7 +609,7 @@ func _ready() -&gt; void:
# so we move at the actual speed of the player
player_speed = player.SPEED / _game_scale
</code></pre>
-<p>This <code>player_speed</code> will be needed as we need to move all the nodes (&ldquo;Background&rdquo;, &ldquo;Camera&rdquo;, etc.) in the <code>x</code> axis as the player is moving. This is done in the <code>_physics_process</code>:</p>
+<p>This <code>player_speed</code> will be needed as we need to move all the nodes (<code>Background</code>, <code>Camera</code>, etc.) in the <code>x</code> axis as the player is moving. This is done in the <code>_physics_process</code>:</p>
<pre><code class="language-gdscript">func _physics_process(delta: float) -&gt; void:
ceiling_detector.move_local_x(player_speed * delta)
world_detector.move_local_x(player_speed * delta)
@@ -584,8 +654,8 @@ func _on_ScoreDetector_body_entered(body: Node2D) -&gt; void:
emit_signal(&quot;new_score&quot;, score, high_score)
score_sound.play()
</code></pre>
-<p>When the <code>player</code> dies, we set all processing to <code>false</code>, except for the player itself (so it can drop all the way to the ground). Also, when receiving a &ldquo;scoring&rdquo; signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the <code>high_score</code> at the beginning by calling <code>SavedData.get_high_score()</code>. This signal we emit will be received by the UI so it updates accordingly.</p>
-<h4 id="ui_1">UI<a class="headerlink" href="#ui_1" title="Permanent link">&para;</a></h4>
+<p>When the <code>player</code> dies, we set all processing to <code>false</code>, except for the player itself (so it can drop all the way to the ground). Also, when receiving a &ldquo;scoring&rdquo; signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the <code>high_score</code> at the beginning by calling <code>SavedData.get_high_score()</code>. This signal we emit will be received by the <code>UI</code> so it updates accordingly.</p>
+<h3 id="ui_1">UI<a class="headerlink" href="#ui_1" title="Permanent link">&para;</a></h3>
<p>First thing is to get a reference to all the child <em>Labels</em>, an initial reference to the high score as well as the version defined in the project settings:</p>
<pre><code class="language-gdscript">onready var fps_label: Label = $MarginContainer/DebugContainer/FPS
onready var version_label: Label = $MarginContainer/VersionContainer/Version
@@ -629,8 +699,8 @@ func _on_Game_new_score(score: int, high_score: int) -&gt; void:
score_label.set_text(String(score))
high_score_label.set_text(&quot;High score: %s&quot; % high_score)
</code></pre>
-<h4 id="main_1">Main<a class="headerlink" href="#main_1" title="Permanent link">&para;</a></h4>
-<p>This is the shortest script, it just connects the signals between the &ldquo;Game&rdquo; and the &ldquo;UI&rdquo;:</p>
+<h3 id="main_1">Main<a class="headerlink" href="#main_1" title="Permanent link">&para;</a></h3>
+<p>This is the shortest script, it just connects the signals between the <code>Game</code> and the <code>UI</code>:</p>
<pre><code class="language-gdscript">onready var game: Game = $Game
onready var ui: UI = $UI
@@ -642,15 +712,15 @@ func _ready() -&gt; void:
game.connect(&quot;game_over&quot;, ui, &quot;_on_Game_game_over&quot;)
game.connect(&quot;new_score&quot;, ui, &quot;_on_Game_new_score&quot;)
</code></pre>
-<h3 id="final-notes-and-exporting">Final notes and exporting<a class="headerlink" href="#final-notes-and-exporting" title="Permanent link">&para;</a></h3>
+<h2 id="final-notes-and-exporting">Final notes and exporting<a class="headerlink" href="#final-notes-and-exporting" title="Permanent link">&para;</a></h2>
<p>At this point the game should be fully playable (if any detail missing feel free to look into the source code linked at the beginning). Only thing missing is an icon for the game; I did one pretty quicly with the assets I had.</p>
-<h4 id="preparing-the-files">Preparing the files<a class="headerlink" href="#preparing-the-files" title="Permanent link">&para;</a></h4>
+<h3 id="preparing-the-files">Preparing the files<a class="headerlink" href="#preparing-the-files" title="Permanent link">&para;</a></h3>
<p>If you followed the directory structure I used, then only thing needed is to transform the icon to a native Windows <code>ico</code> format (if exporting to Windows, else ignore this part). For this you need <a href="https://imagemagick.org/index.php">ImageMagick</a> or some other program that can transform <code>png</code> (or whatever file format you used for the icon) to <code>ico</code>. I used [Chocolatey][https://chocolatey.org/] to install <code>imagemagick</code>, then to convert the icon itself used: <code>magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico</code> as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/changing_application_icon_for_windows.html">Changing application icon for Windows</a>.</p>
-<h4 id="exporting">Exporting<a class="headerlink" href="#exporting" title="Permanent link">&para;</a></h4>
-<p>You need to download the templates for exporting as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html">Exporting projects</a>. Basically you go to <em>Editor -&gt; Manage Export Templates&hellip;</em> and download the latest one specific to your <em>Godot</em> version by clicking on &ldquo;Download and Install&rdquo;.</p>
+<h3 id="exporting">Exporting<a class="headerlink" href="#exporting" title="Permanent link">&para;</a></h3>
+<p>You need to download the templates for exporting as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html">Exporting projects</a>. Basically you go to <em>Editor -&gt; Manage Export Templates&hellip;</em> and download the latest one specific to your <em>Godot</em> version by clicking on <code>Download and Install</code>.</p>
<p>If exporting for Windows then you also need to download <code>rcedit</code> from <a href="https://github.com/electron/rcedit/releases/latest">here</a>. Just place it wherever you want (I put it next to the <em>Godot</em> executable).</p>
-<p>Then go to <em>Project -&gt; Export&hellip;</em> and the Window should be empty, add a new template by clicking on &ldquo;Add&hellip;&rdquo; at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the &ldquo;Export Path&rdquo; for each template, which is te location of where the executable will be written to, and in the case of the Windows Desktop template you could also setup stuff like &ldquo;Company Name&rdquo;, &ldquo;Product Name&rdquo;, &ldquo;File/Product Version&rdquo;, etc..</p>
-<p>Once the templates are setup, select any and click on &ldquo;Export Project&rdquo; at the bottom, and make sure to untoggle &ldquo;Export With Debug&rdquo; in the window that pops up, this checkbox should be at the bottom of the new window.</p>
+<p>Then go to <em>Project -&gt; Export&hellip;</em> and the Window should be empty, add a new template by clicking on <code>Add...</code> at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the &ldquo;Export Path&rdquo; for each template, which is te location of where the executable will be written to, and in the case of the <em>Windows Desktop</em> template you could also setup stuff like <code>Company Name</code>, <code>Product Name</code>, <code>File/Product Version</code>, etc..</p>
+<p>Once the templates are setup, select any and click on <code>Export Project</code> at the bottom, and make sure to untoggle <code>Export With Debug</code> in the window that pops up, this checkbox should be at the bottom of the new window.</p>
<div class="page-nav">
<span class="next">
@@ -680,10 +750,10 @@ func _ready() -&gt; void:
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, May 29, 2022 @ 03:38 UTC</p>
- <p>Modified: Sun, May 29, 2022 @ 03:44 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 18:26 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a> </p>
+<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@gdscript.html">gdscript</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a> </p>
</div>
</div>
diff --git a/live/blog/g/godot_project_structure.html b/live/blog/g/godot_project_structure.html
index a45692f..fd6c56e 100644
--- a/live/blog/g/godot_project_structure.html
+++ b/live/blog/g/godot_project_structure.html
@@ -16,13 +16,12 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
<!-- og meta -->
<meta property="og:title" content="General Godot project structure -- Luevano's Blog"/>
@@ -73,6 +72,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>General Godot project structure</h1>
<p>One of my first issues when starting a project is how to structure everything. So I had to spend some time researching best practices and go with what I like the most and after trying some of them I wanted to write down somewhere what I&rsquo;m sticking with.</p>
@@ -226,10 +230,10 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Sun, May 22, 2022 @ 01:16 UTC</p>
- <p>Modified: Tue, May 24, 2022 @ 04:35 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:37 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a> </p>
+<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a> </p>
</div>
</div>
diff --git a/live/blog/g/gogodot_jam3_devlog_1.html b/live/blog/g/gogodot_jam3_devlog_1.html
index 31060cb..55c3e1c 100644
--- a/live/blog/g/gogodot_jam3_devlog_1.html
+++ b/live/blog/g/gogodot_jam3_devlog_1.html
@@ -16,14 +16,23 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
+
+
+
+ <!-- highlight support for code blocks -->
<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+ <!-- Specific to GDScript -->
+ <script type="text/javascript" src="https://static.luevano.xyz/hl/languages/gdscript.min.js"></script>
+
<!-- og meta -->
<meta property="og:title" content="Creating my Go Godot Jam 3 entry using Godot 3.5 devlog 1 -- Luevano's Blog"/>
<meta property="og:type" content="article"/>
@@ -73,35 +82,70 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Creating my Go Godot Jam 3 entry using Godot 3.5 devlog 1</h1>
- <p>The jam&rsquo;s theme is Evolution and all the details are listed <a href="https://itch.io/jam/go-godot-jam-3">here</a>. <del>This time I&rsquo;m logging as I go, so there might be some changes to the script or scenes along the way</del> <ins>I couldn&rsquo;t actually do this, as I was running out of time.</ins>. Note that I&rsquo;m not going to go into much details, the obvious will be ommitted.</p>
+ <p>The jam&rsquo;s theme is Evolution and all the details are listed <a href="https://itch.io/jam/go-godot-jam-3">here</a>. <del>This time I&rsquo;m logging as I go, so there might be some changes to the script or scenes along the way.</del> <ins>I couldn&rsquo;t actually do this, as I was running out of time</ins>. Note that I&rsquo;m not going to go into much details, the obvious will be ommitted.</p>
<p>I wanted to do a <em>Snake</em> clone, and I&rsquo;m using this jam as an excuse to do it and add something to it. The features include:</p>
<ul>
<li>Snakes will pass their stats in some form to the next snakes.</li>
<li>Non-grid snake movement. I just hate the grid constraint, so I wanted to make it move in any direction.</li>
-<li>Depending on the food you eat, you&rsquo;ll gain new mutations/abilities <del>and the more you eat the more that mutation develops.</del> <ins>didn&rsquo;t have time to add this feature, sad.</ins></li>
+<li>Depending on the food you eat, you&rsquo;ll gain new mutations/abilities <del>and the more you eat the more that mutation develops</del> <ins>didn&rsquo;t have time to add this feature, sad</ins>.</li>
<li>Procedural map creation.</li>
</ul>
-<p>I created this game using <em>Godot 3.5-rc3</em>. You can find the source code in my GitHub <a href="https://github.com/luevano/gogodot_jam3">here</a> which at the time of writing this it doesn&rsquo;t contain any exported files, for that you can go ahead and play it in your browser at itch.io, which you can find below:</p>
-<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
+<p>I created this game using <em>Godot 3.5-rc3</em>. You can find the source code in my GitHub <a href="https://github.com/luevano/gogodot_jam3">here</a> which at the time of writing this it doesn&rsquo;t contain any exported files, for that you can go ahead and play it in your browser at <a href="https://lorentzeus.itch.io/snake-tronic">itch.io</a>, which you can find below:</p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
<p>You can also find the jam entry <a href="https://itch.io/jam/go-godot-jam-3/rate/1562701">here</a>.</p>
<p>Similarly with the my FlappyBird clone, I plan to update this to a better state.</p>
-<h3 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h3>
-<p>Again, similar to the <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">FlappyBird</a> clone I developed, I&rsquo;m using the directory structure I wrote about on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> with slight modifications to test things out. Also using similar <em>Project settings</em> as those from the <em>FlappyBird</em> clone like the pixel art texture imports, keybindings, layers, etc..</p>
-<p>I&rsquo;ve also setup <a href="https://github.com/bram-dingelstad/godot-gifmaker">GifMaker</a>, with slight modifications as the <em>AssetLib</em> doesn&rsquo;t install it correctly and contains unnecessry stuff: moved necessary files to the <code>res://addons</code> directory, deleted test scenes and files in general, and copied the license to the <code>res://docs</code> directory. Setting this up was a bit annoying because the tutorial it&rsquo;s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn&rsquo;t find it anywhere other than by inspecting some of the code/scenes.<ins>I ended up not leaving this enabled in the game as it lagged the game out, but it&rsquo;s an option I&rsquo;ll end up researching more.</ins></p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#initial-setup">Initial setup</a></li>
+<li><a href="#assets">Assets</a></li>
+<li><a href="#the-snake">The snake</a><ul>
+<li><a href="#basic-movement">Basic movement</a></li>
+<li><a href="#setting-up-path-following">Setting up path following</a></li>
+<li><a href="#define-body-parts-for-the-snake">Define body parts for the snake</a></li>
+<li><a href="#adding-body-parts">Adding body parts</a></li>
+<li><a href="#fix-on-body-segments-following-head">Fix on body segments following head</a></li>
+</ul>
+</li>
+<li><a href="#the-food">The food</a></li>
+<li><a href="#za-warudo-the-world">Za warudo! (The world)</a><ul>
+<li><a href="#food-placement">Food placement</a></li>
+</ul>
+</li>
+<li><a href="#stats-clas-and-loadingsaving-data">Stats clas and loading/saving data</a><ul>
+<li><a href="#stats-class">Stats class</a></li>
+<li><a href="#loadsave-data">Load/save data</a></li>
+</ul>
+</li>
+<li><a href="#scoring">Scoring</a></li>
+<li><a href="#snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern</a></li>
+<li><a href="#other-minor-stuff">Other minor stuff</a></li>
+<li><a href="#final-notes">Final notes</a></li>
+</ul>
+</div>
+<h2 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h2>
+<p>Again, similar to the <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">FlappyBird</a> clone I created, I&rsquo;m using the directory structure I wrote about on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> with slight modifications to test things out. Also using similar <em>Project settings</em> as those from the <em>FlappyBird</em> clone like the pixel art texture imports, keybindings, layers, etc..</p>
+<p>I&rsquo;ve also setup <a href="https://github.com/bram-dingelstad/godot-gifmaker">GifMaker</a>, with slight modifications as the <em>AssetLib</em> doesn&rsquo;t install it correctly and contains unnecessry stuff: moved necessary files to the <code>res://addons</code> directory, deleted test scenes and files in general, and copied the license to the <code>res://docs</code> directory. Setting this up was a bit annoying because the tutorial it&rsquo;s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn&rsquo;t find it anywhere other than by inspecting some of the code/scenes. <ins>I ended up leaving this disabled in the game as it hit the performance by a lot, but it&rsquo;s an option I&rsquo;ll end up researching more</ins>.</p>
<p>This time I&rsquo;m also going to be using an <a href="https://www.gdquest.com/docs/guidelines/best-practices/godot-gdscript/event-bus/">Event bus</a> singleton (which I&rsquo;m going to just call <em>Event</em>) as managing signals was pretty annoying on my last project; as well as a <em>Global</em> singleton for essential stuff so I don&rsquo;t have to do as many cross references between nodes/scenes.</p>
-<h3 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h3>
+<h2 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h2>
<p>This time I&rsquo;ll be creating my own assets in <a href="https://www.aseprite.org/">Aseprite</a>, wont be that good, but enough to prototype and get things going.</p>
<p>Other than that I used few key sprites from <a href="https://vryell.itch.io/">vryell</a>: <a href="https://vryell.itch.io/controller-keyboard-icons">Controller &amp; Keyboard Icons</a> and a font from <a href="https://datagoblin.itch.io/">datagoblin</a>: <a href="https://datagoblin.itch.io/monogram">Monogram</a>.</p>
-<h3 id="the-snake">The snake<a class="headerlink" href="#the-snake" title="Permanent link">&para;</a></h3>
+<h2 id="the-snake">The snake<a class="headerlink" href="#the-snake" title="Permanent link">&para;</a></h2>
<p>This is the most challenging part in my opinion as making all the body parts follow the head in a user defined path it&rsquo;s kinda hard. I tried with like 4-5 options and the one I&rsquo;m detailing here is the only one that worked as I wanted for me. This time the directory structure I&rsquo;m using is the following:</p>
<figure id="__yafg-figure-32">
-<img alt="FileSystem - Snake dir structure" src="images/g/gogodot_jam3/file_system_snake_dir_structure.png" title="FileSystem - Snake dir structure">
+<img alt="FileSystem - Snake dir structure" src="https://static.luevano.xyz/images/g/gogodot_jam3/file_system_snake_dir_structure.png" title="FileSystem - Snake dir structure">
<figcaption>FileSystem - Snake dir structure</figcaption>
</figure>
-<h4 id="basic-movement">Basic movement<a class="headerlink" href="#basic-movement" title="Permanent link">&para;</a></h4>
+<h3 id="basic-movement">Basic movement<a class="headerlink" href="#basic-movement" title="Permanent link">&para;</a></h3>
<p>The most basic thing is to move the head, this is what we have control of. Create a scene called <code>Head.tscn</code> and setup the basic <em>KinematicBody2D</em> with it&rsquo;s own <em>Sprite</em> and <em>CollisionShape2D</em> (I used a small circle for the tip of the head), and set the <em>Collision Layer/Mask</em> accordingly, for now just <code>layer = bit 1</code>. And all we need to do, is keep moving the snake forwards and be able to rotate left or right. Created a new script called <code>head.gd</code> attached to the root (<em>KinematicBody2D</em>) and added:</p>
<pre><code class="language-gdscript">extends KinematicBody2D
@@ -132,10 +176,10 @@ func _rotate_to(direction: int) -&gt; void:
</code></pre>
<p>After tunning all the necessary parameters you should get something like this:</p>
<figure id="__yafg-figure-33">
-<img alt="Snake - Basic movement (left and right controls)" src="images/g/gogodot_jam3/snake_basic_movement.gif" title="Snake - Basic movement (left and right controls)">
+<img alt="Snake - Basic movement (left and right controls)" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement.gif" title="Snake - Basic movement (left and right controls)">
<figcaption>Snake - Basic movement (left and right controls)</figcaption>
</figure>
-<h4 id="setting-up-path-following">Setting up path following<a class="headerlink" href="#setting-up-path-following" title="Permanent link">&para;</a></h4>
+<h3 id="setting-up-path-following">Setting up path following<a class="headerlink" href="#setting-up-path-following" title="Permanent link">&para;</a></h3>
<p>To move other snake parts by following the snake head the only solution I found was to use the <em>Path2D</em> and <em>PathFollow2D</em> nodes. <em>Path2D</em> basically just handles the curve/path that <em>PathFollow2D</em> will use to move its child node; and I say &ldquo;child node&rdquo; in singular&hellip; as <em>PathFollow2D</em> can only handle one damn child, all the other ones will have weird transformations and/or rotations. So, the next thing to do is to setup a way to compute (and draw so we can validate) the snake&rsquo;s path/curve.</p>
<p>Added the signal <code>snake_path_new_point(coordinates)</code> to the <em>Event</em> singleton and then add the following to <code>head.gd</code>:</p>
<pre><code class="language-gdscript">var _time_elapsed: float = 0.0
@@ -169,10 +213,10 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -&gt; void:
</code></pre>
<p>With this, we&rsquo;re now populating the <em>Path2D</em> curve points with the position of the snake head. You should be able to see it because of the <code>_draw</code> call. If you run it you should see something like this:</p>
<figure id="__yafg-figure-34">
-<img alt="Snake - Basic movement with path" src="images/g/gogodot_jam3/snake_basic_movement_with_path.gif" title="Snake - Basic movement with path">
+<img alt="Snake - Basic movement with path" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_path.gif" title="Snake - Basic movement with path">
<figcaption>Snake - Basic movement with path</figcaption>
</figure>
-<h4 id="define-body-parts-for-the-snake">Define body parts for the snake<a class="headerlink" href="#define-body-parts-for-the-snake" title="Permanent link">&para;</a></h4>
+<h3 id="define-body-parts-for-the-snake">Define body parts for the snake<a class="headerlink" href="#define-body-parts-for-the-snake" title="Permanent link">&para;</a></h3>
<p>At this point the only thing to do is to add the corresponding next body parts and tail of the snake. To do so, we need a <em>PathFollow2D</em> to use the live-generating <em>Path2D</em>, the only caveat is that we need one of these per body part/tail (this took me hours to figure out, <em>thanks documentation</em>).</p>
<p>Create a new scene called <code>Body.tscn</code> with a <em>PathFollow2D</em> as its root and an <em>Area2D</em> as its child, then just add the necessary <em>Sprite</em> and <em>CollisionShap2D</em> for the <em>Area2D</em>, I&rsquo;m using <code>layer = bit 2</code> for its collision. Create a new script called <code>generic_segment.gd</code> with the following code:</p>
<pre><code class="language-gdscript">extends PathFollow2D
@@ -184,7 +228,7 @@ func _physics_process(delta: float) -&gt; void:
offset += Global.SNAKE_SPEED * delta
</code></pre>
<p>And this can be attached to the <em>Body</em>&lsquo;s root node (<em>PathFollow2D</em>), no extra setup needed. Repeat the same steps for creating the <code>Tail.tscn</code> scene and when attaching the <code>generic_segment.gd</code> script just configure the <code>Type</code> parameter to <code>tail</code> in the GUI (by selecting the node with the script attached and editing in the <em>Inspector</em>).</p>
-<h4 id="adding-body-parts">Adding body parts<a class="headerlink" href="#adding-body-parts" title="Permanent link">&para;</a></h4>
+<h3 id="adding-body-parts">Adding body parts<a class="headerlink" href="#adding-body-parts" title="Permanent link">&para;</a></h3>
<p>Now it&rsquo;s just a matter of handling when to add new body parts in the <code>snake.gd</code> script. For now I&rsquo;ve only setup for adding body parts to fulfill the initial length of the snake (this doesn&rsquo;t include the head or tail). The extra code needed is the following:</p>
<pre><code class="language-gdscript">export(PackedScene) var BODY_SEGMENT_NP: PackedScene
export(PackedScene) var TAIL_SEGMENT_NP: PackedScene
@@ -213,7 +257,7 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -&gt; void:
</code></pre>
<p>Select the <em>Snake</em> node and add the <em>Body</em> and <em>Tail</em> scene to the parameters, respectively. Then when running you should see something like this:</p>
<figure id="__yafg-figure-35">
-<img alt="Snake - Basic movement with all body parts" src="images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif" title="Snake - Basic movement with all body parts">
+<img alt="Snake - Basic movement with all body parts" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif" title="Snake - Basic movement with all body parts">
<figcaption>Snake - Basic movement with all body parts</figcaption>
</figure>
<p>Now, we need to handle adding body parts after the snake is complete and already moved for a bit, this will require a queue so we can add part by part in the case that we eat multiple pieces of food in a short period of time. For this we need to add some signals: <code>snake_adding_new_segment(type)</code>, <code>snake_added_new_segment(type)</code>, <code>snake_added_initial_segments</code> and use them when makes sense. Now we need to add the following:</p>
@@ -254,9 +298,9 @@ func _add_segment_to_queue() -&gt; void:
else:
body_segment_queue.append(body_segment_queue.back() + Global.SNAKE_SEGMENT_SIZE)
</code></pre>
-<p>With everything implemented and connected accordingly then we can add segments on demand (for testing I&rsquo;m adding with a keystroke), it should look like this:</p>
+<p>With everything implemented and connected accordingly then we can add segments on demand (for testing I&rsquo;m adding with a key press), it should look like this:</p>
<figure id="__yafg-figure-36">
-<img alt="Snake - Basic movement with dynamic addition of new segments" src="images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif" title="Snake - Basic movement with dynamic addition of new segments">
+<img alt="Snake - Basic movement with dynamic addition of new segments" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif" title="Snake - Basic movement with dynamic addition of new segments">
<figcaption>Snake - Basic movement with dynamic addition of new segments</figcaption>
</figure>
<p>For now, this should be enough, I&rsquo;ll add more stuff as needed as I go. Last thing is that after finished testing that the movement felt ok, I just added a way to stop the snake whenever it collides with itself by using the following code (and the signal <code>snake_segment_body_entered(body)</code>) in a <code>main.gd</code> script that is the entry point for the game:</p>
@@ -268,13 +312,13 @@ func _add_segment_to_queue() -&gt; void:
_snake.propagate_call(&quot;set_process_input&quot;, [on_off])
</code></pre>
<p>Which will stop the snake node and all children.</p>
-<h4 id="fix-on-body-segments-following-head">Fix on body segments following head<a class="headerlink" href="#fix-on-body-segments-following-head" title="Permanent link">&para;</a></h4>
+<h3 id="fix-on-body-segments-following-head">Fix on body segments following head<a class="headerlink" href="#fix-on-body-segments-following-head" title="Permanent link">&para;</a></h3>
<p>After a while of testing and developing, I noticed that sometimes the head &ldquo;detaches&rdquo; from the body when a lot of rotations happen (moving the snake left or right), because of how imprecise the <em>Curve2D</em> is. To do this I just send a signal (<code>snake_rotated</code>) whenever the snake rotates and make a small correction (in <code>generic_segment.gd</code>):</p>
<pre><code class="language-gdscript">func _on_snake_rotated() -&gt; void:
offset -= 0.75 * Global.SNAKE_SPEED * pow(get_physics_process_delta_time(), 2)
</code></pre>
<p>This is completely random, I tweaked it manually after a lot of iterations.</p>
-<h3 id="the-food">The food<a class="headerlink" href="#the-food" title="Permanent link">&para;</a></h3>
+<h2 id="the-food">The food<a class="headerlink" href="#the-food" title="Permanent link">&para;</a></h2>
<p>For now I just decided to setup a simple system to see everything works fine. The idea is to make some kind of generic food node/scene and a &ldquo;food manager&rdquo; to spawn them, for now in totally random locations. For this I added the following signals: <code>food_placing_new_food(type)</code>, <code>food_placed_new_food(type)</code> and <code>food_eaten(type)</code>.</p>
<p>First thing is creating the <code>Food.tscn</code> which is just an <em>Area2D</em> with its necessary children with an attached script called <code>food.gd</code>. The script is really simple:</p>
<pre><code class="language-gdscript">class_name Food # needed to access Type enum outside of the script, this registers this script as a node
@@ -319,21 +363,21 @@ func _on_body_entered(body: Node) -&gt; void:
</code></pre>
<p>And this is used in <code>_process</code> to place new food whenever needed. For now I added a condition to add food until 10 pieces are in place, and keep adding whenever the food is is lower than 10. After setting everything up, this is the result:</p>
<figure id="__yafg-figure-37">
-<img alt="Snake - Food basic interaction" src="images/g/gogodot_jam3/snake_food_basic_interaction.gif" title="Snake - Food basic interaction">
+<img alt="Snake - Food basic interaction" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_food_basic_interaction.gif" title="Snake - Food basic interaction">
<figcaption>Snake - Food basic interaction</figcaption>
</figure>
-<h3 id="za-warudo-the-world">Za warudo! (The world)<a class="headerlink" href="#za-warudo-the-world" title="Permanent link">&para;</a></h3>
+<h2 id="za-warudo-the-world">Za warudo! (The world)<a class="headerlink" href="#za-warudo-the-world" title="Permanent link">&para;</a></h2>
<p>It just happend that I saw a video to create random maps by using a method called <a href="https://www.mit.edu/~kardar/teaching/projects/chemotaxis(AndreaSchmidt)/random.htm">random walks</a>, this video was made by <a href="https://www.youtube.com/c/NADLABS">NAD LABS</a>: <a href="https://www.youtube.com/watch?v=ppP2Doq3p7s">Nuclear Throne Like Map Generation In Godot</a>. It&rsquo;s a pretty simple but powerful script, he provided the source code from which I based my random walker, just tweaked a few things and added others. Some of the maps than can be generated with this method (already aded some random sprites):</p>
<figure id="__yafg-figure-38">
-<img alt="World map generator - Random map 1" src="images/g/gogodot_jam3/world_generator_1.png" title="World map generator - Random map 1">
+<img alt="World map generator - Random map 1" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_1.png" title="World map generator - Random map 1">
<figcaption>World map generator - Random map 1</figcaption>
</figure>
<figure id="__yafg-figure-39">
-<img alt="World map generator - Random map 2" src="images/g/gogodot_jam3/world_generator_2.png" title="World map generator - Random map 2">
+<img alt="World map generator - Random map 2" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_2.png" title="World map generator - Random map 2">
<figcaption>World map generator - Random map 2</figcaption>
</figure>
<figure id="__yafg-figure-40">
-<img alt="World map generator - Random map 3" src="images/g/gogodot_jam3/world_generator_3.png" title="World map generator - Random map 3">
+<img alt="World map generator - Random map 3" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_3.png" title="World map generator - Random map 3">
<figcaption>World map generator - Random map 3</figcaption>
</figure>
<p>It started with just black and white tiles, but I ended up adding some sprites as it was really harsh to the eyes. My implementation is basically the same as <em>NAD LABS</em>&lsquo; with few changes, most importantly: I separated the generation in 2 diferent tilemaps (floor and wall) to have better control as well as wrapped everything in a single scene with a &ldquo;main&rdquo; script with the following important functions:</p>
@@ -350,7 +394,7 @@ func get_centered_world_position(location: Vector2) -&gt; Vector2:
</code></pre>
<p>Where <code>get_cells_around</code> is just a function that gets the safe cells around the origin. And this <code>get_valid_map_coords</code> just returns used cells minus the safe cells, to place food. <code>get_centered_world_position</code> is so we can center the food in the tiles.</p>
<p>Some signals I used for the world gen: <code>world_gen_walker_started(id)</code>, <code>world_gen_walker_finished(id)</code>, <code>world_gen_walker_died(id)</code> and <code>world_gen_spawn_walker_unit(location)</code>.</p>
-<h4 id="food-placement">Food placement<a class="headerlink" href="#food-placement" title="Permanent link">&para;</a></h4>
+<h3 id="food-placement">Food placement<a class="headerlink" href="#food-placement" title="Permanent link">&para;</a></h3>
<p>The last food algorithm doesn&rsquo;t check anything related to the world, and thus the food could spawn in the walls and outside the map.</p>
<p>First thing is I generalized the food into a single script and added basic food and special food which inherit from base food. The most important stuff for the base food is to be able to set all necessary properties at first:</p>
<pre><code class="language-gdscript">func update_texture() -&gt; void:
@@ -400,10 +444,10 @@ func _ready():
return [world_generator.get_centered_world_position(location), location]
</code></pre>
<p>Other than that, there are some differences between placing normal and special food (specially the signal they send, and if an extra &ldquo;special points&rdquo; property is set). Some of the signals that I used that might be important: <code>food_placing_new_food(type)</code>, <code>food_placed_new_food(type, location)</code> and <code>food_eaten(type, location)</code>.</p>
-<h3 id="stats-clas-and-loadingsaving-data">Stats clas and loading/saving data<a class="headerlink" href="#stats-clas-and-loadingsaving-data" title="Permanent link">&para;</a></h3>
-<p>I got the idea of saving the current stats (points, max body segments, etc.) in a separate <em>Stats</em> class for easier load/save data. This option I went with didn&rsquo;t work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions&hellip; so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving <code>tres</code> files).</p>
-<h4 id="stats-class">Stats class<a class="headerlink" href="#stats-class" title="Permanent link">&para;</a></h4>
-<p>The <em>Stats</em> &ldquo;class&rdquo; is just a script that extends from <em>Node</em> called <code>stats.gd</code>. It needs to define the <code>class_name</code> as <code>Stats</code>. The main content:</p>
+<h2 id="stats-clas-and-loadingsaving-data">Stats clas and loading/saving data<a class="headerlink" href="#stats-clas-and-loadingsaving-data" title="Permanent link">&para;</a></h2>
+<p>I got the idea of saving the current stats (points, max body segments, etc.) in a separate <code>Stats</code> class for easier load/save data. This option I went with didn&rsquo;t work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions&hellip; so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving <code>tres</code> files).</p>
+<h3 id="stats-class">Stats class<a class="headerlink" href="#stats-class" title="Permanent link">&para;</a></h3>
+<p>The <code>Stats</code> &ldquo;class&rdquo; is just a script that extends from <em>Node</em> called <code>stats.gd</code>. It needs to define the <code>class_name</code> as <code>Stats</code>. The main content:</p>
<pre><code class="language-gdscript"># main
var points: int = 0
var segments: int = 0
@@ -465,8 +509,8 @@ func set_stats(stats: Dictionary) -&gt; void:
trait_jump = stats[&quot;trait_jump&quot;]
</code></pre>
<p>And this is not scalable at all, but I had to do this at the end of the jam so no way of optimizing and/or doing it correctly, sadly.</p>
-<h4 id="loadsave-data">Load/save data<a class="headerlink" href="#loadsave-data" title="Permanent link">&para;</a></h4>
-<p>The load/save function is pretty standard. It&rsquo;s a singleton/autoload called <em>SavedData</em> with a script that extends from <em>Node</em> called <code>save_data.gd</code>:</p>
+<h3 id="loadsave-data">Load/save data<a class="headerlink" href="#loadsave-data" title="Permanent link">&para;</a></h3>
+<p>The load/save function is pretty standard. It&rsquo;s a singleton/autoload called <code>SavedData</code> with a script that extends from <em>Node</em> called <code>save_data.gd</code>:</p>
<pre><code class="language-gdscript">const DATA_PATH: String = &quot;user://data.save&quot;
var _stats: Stats
@@ -508,9 +552,9 @@ func _handle_new_file() -&gt; void:
file.store_line(to_json(_stats.get_stats()))
file.close()
</code></pre>
-<p>It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (<em>Stats</em> class related issues).</p>
-<h3 id="scoring">Scoring<a class="headerlink" href="#scoring" title="Permanent link">&para;</a></h3>
-<p>For this I created a scoring mechanisms and just called it <em>ScoreManager</em> (<code>score_manager.gd</code>) which just basically listens to <code>food_eaten</code> signal and adds points accordingly to the current <em>Stats</em> object loaded. The main function is:</p>
+<p>It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (<code>Stats</code> class related issues).</p>
+<h2 id="scoring">Scoring<a class="headerlink" href="#scoring" title="Permanent link">&para;</a></h2>
+<p>For this I created a scoring mechanisms and just called it <code>ScoreManager</code> (<code>score_manager.gd</code>) which just basically listens to <code>food_eaten</code> signal and adds points accordingly to the current <em>Stats</em> object loaded. The main function is:</p>
<pre><code class="language-gdscript">func _on_food_eaten(properties: Dictionary) -&gt; void:
var is_special: bool = properties[&quot;special&quot;]
var type: int = properties[&quot;type&quot;]
@@ -550,7 +594,7 @@ func _handle_new_file() -&gt; void:
</code></pre>
<p>Which will add the necessary points to <code>Stats.points</code> and return the amount of new snake segments to grow. After this <code>_spawn_added_score_segment</code> and <code>_spawn_added_segment_text</code> just spawn a <em>Label</em> with the info on the points/segments gained; this is custom UI I created, nothing fancy.</p>
<p>Last thing is taht in <code>_process_points</code> there is a check at the end, where if the food eaten is &ldquo;special&rdquo; then a custom variation of the last 3 functions are executed. These are really similar, just specific to each kind of food.</p>
-<p>This <em>ScoreManager</em> also handles the calculation for the <code>game_over</code> signal, to calculte progress, set necessary <em>Stats</em> values and save the data:</p>
+<p>This <code>ScoreManager</code> also handles the calculation for the <code>game_over</code> signal, to calculte progress, set necessary <code>Stats</code> values and save the data:</p>
<pre><code class="language-gdscript">func _on_game_over() -&gt; void:
var max_stats: Stats = _get_max_stats()
SaveData.save_data(max_stats)
@@ -577,8 +621,8 @@ func _get_max_stats() -&gt; Stats:
return max_stats
</code></pre>
<p>Then this sends a signal <code>display_stats</code> to activate UI elements that shows the progression.</p>
-<p>Naturally, the saved <em>Stats</em> are loaded whenever needed. For example, for the <em>Snake</em>, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we&rsquo;re saving the new <em>Stats</em> at the end, then on restart we load the updated one.</p>
-<h3 id="snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern<a class="headerlink" href="#snake-redesigned-with-the-state-machine-pattern" title="Permanent link">&para;</a></h3>
+<p>Naturally, the saved <code>Stats</code> are loaded whenever needed. For example, for the <code>Snake</code>, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we&rsquo;re saving the new <code>Stats</code> at the end, then on restart we load the updated one.</p>
+<h2 id="snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern<a class="headerlink" href="#snake-redesigned-with-the-state-machine-pattern" title="Permanent link">&para;</a></h2>
<p>I redesigned the snake code (the head, actually) to use the state machine pattern by following <a href="https://gdscript.com/solutions/godot-state-machine/">this guide</a> which is definitely a great guide, straight to the point and easy to implement.</p>
<p>Other than what is shown in the guide, I implemented some important functions in the <code>state_machine.gd</code> script itself, to be used by each of the states as needed:</p>
<pre><code class="language-gdscript">func rotate_on_input() -&gt; void:
@@ -600,7 +644,7 @@ func handle_slow_speeds() -&gt; void:
Global.SNAKE_SPEED = Global.SNAKE_SPEED_BACKUP
Event.emit_signal(&quot;game_over&quot;)
</code></pre>
-<p>And then in the <em>StateMachine</em>&lsquo;s <code>_process</code>:</p>
+<p>And then in the <code>StateMachine</code>&lsquo;s <code>_process</code>:</p>
<pre><code class="language-gdscript">func _physics_process(delta: float) -&gt; void:
# state specific code, move_and_slide is called here
if state.has_method(&quot;physics_process&quot;):
@@ -652,7 +696,7 @@ func physics_process(delta: float) -&gt; void:
</code></pre>
<p>Where the important parts happen in the <code>enter</code> and <code>exit</code> functions. We need to change the <code>Global.SNAKE_SPEED</code> with the <code>Global.SNAKE_DASH_SPEED</code> on <code>start</code>and start the timer for how long should the dash last. And on the <code>exit</code> we reset the <code>Global.SNAKE_SPEED</code> back to normal. There is probably a better way of updating the <code>Global.SNAKE_SPEED</code> but this works just fine.</p>
<p>For the other ones is the same. Only difference with the <code>jump_state.gd</code> is that the collision from head to body is disabled, and no rotation is allowed (by not calling the <code>rotate_on_input</code> function).</p>
-<h3 id="other-minor-stuff">Other minor stuff<a class="headerlink" href="#other-minor-stuff" title="Permanent link">&para;</a></h3>
+<h2 id="other-minor-stuff">Other minor stuff<a class="headerlink" href="#other-minor-stuff" title="Permanent link">&para;</a></h2>
<p>Not as important but worth mentioning:</p>
<ul>
<li>Added restartability function.</li>
@@ -666,9 +710,9 @@ func physics_process(delta: float) -&gt; void:
<li>Refactored the nodes to make it work with <code>change_scene_to</code>, and added a main menu.</li>
<li>Added GUI for dead screen, showing the progress.</li>
</ul>
-<h3 id="final-notes">Final notes<a class="headerlink" href="#final-notes" title="Permanent link">&para;</a></h3>
-<p>I actually didn&rsquo;t finish this game (as how I visualized it), but I got it in a playable state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.</p>
-<p>For exporting and everything else, I went with what I did for my <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting">FlappyBird Godot clone</a></p>
+<h2 id="final-notes">Final notes<a class="headerlink" href="#final-notes" title="Permanent link">&para;</a></h2>
+<p>I actually didn&rsquo;t finish this game (as how I visualized it), but I got it in a <em>semi-playable</em> state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.</p>
+<p>For exporting and everything else, I went with what I did for my <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting">FlappyBird Godot clone: final notes and exporting</a></p>
<div class="page-nav">
<span class="next">
@@ -698,9 +742,10 @@ func physics_process(delta: float) -&gt; void:
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Fri, Jun 10, 2022 @ 09:17 UTC</p>
+ <p>Modified: Thu, May 04, 2023 @ 17:05 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@gamejam.html">gamejam</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a> </p>
+<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@gamejam.html">gamejam</a>, <a href="https://blog.luevano.xyz/tag/@gdscript.html">gdscript</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a> </p>
</div>
</div>
diff --git a/live/blog/g/starting_gamedev_blogging.html b/live/blog/g/starting_gamedev_blogging.html
index 20fc5ce..82c4cd2 100644
--- a/live/blog/g/starting_gamedev_blogging.html
+++ b/live/blog/g/starting_gamedev_blogging.html
@@ -16,13 +16,13 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
-<!-- highlight support for code blocks -->
-<script type="text/javascript" src="https://static.luevano.xyz/hl/highlight.min.js"></script>
-<script type="text/javascript">
- hljs.initHighlightingOnLoad();
-</script>
-<link id="code-theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/hl/styles/nord.min.css">
+
+
+
+
<!-- og meta -->
<meta property="og:title" content="Will start blogging about gamedev -- Luevano's Blog"/>
@@ -73,11 +73,17 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Will start blogging about gamedev</h1>
- <p>I&rsquo;ve been wanting to get into gamedev for a while now, but it&rsquo;s always a pain to stay consistent. I just recently started to get into gamedev again, and this time I&rsquo;m trying to actually do stuff.</p>
+ <p>I&rsquo;ve been wanting to get into gamedev for a while now, but it&rsquo;s always a pain to stay consistent. I just recently started to get into it again, and this time I&rsquo;m trying to actually do stuff.</p>
<p>So, the plan is to blog about my progress and clone some simple games just to get started. I&rsquo;m thinking on sticking with <a href="https://godotengine.org/">Godot</a> just because I like that it&rsquo;s open source, it&rsquo;s getting better and better overtime (big rewrite happening right now) and I already like how the engine works. <del>Specifically I&rsquo;ll start using <em>Godot 4</em> even though it&rsquo;s not done yet, to get used to the new features, specifically pumped for <a href="https://godotengine.org/article/gdscript-progress-report-feature-complete-40">GDScript 2.0</a>.</del> <ins>Actually&hellip; (for the small clones/ripoffs) I&rsquo;ll need to use <em>Godot 3.X</em> (probably 3.5), as <em>Godot 4</em> doesn&rsquo;t have support to export to webassembly (HTML5) yet, and I want that to publish to <a href="https://itch.io/">itch.io</a> and my website. I&rsquo;ll continue to use <em>Godot 4</em> for bigger projects, as they will take longer and I hope that by the time I need to publish, there&rsquo;s no issues to export.</ins></p>
<p>For a moment I almost started a new subdomain just for gamedev stuff, but decided to just use a different directory for subtleness; this directory and use of tags should be enough. I&rsquo;ll be posting the entry about the first rip-off I&rsquo;m <em>developing</em> (FlappyBird L O L) shortly.</p>
+<p><strong>Update</strong>: <a href="https://godotengine.org/article/godot-4-0-sets-sail/">Godot 4</a> already released and it now has HTML5 support, so back to the original plan.</p>
<div class="page-nav">
<span class="next">
@@ -107,10 +113,10 @@
<div class="article-info">
<p>By David Luévano</p>
<p>Created: Tue, May 17, 2022 @ 05:19 UTC</p>
- <p>Modified: Sun, May 22, 2022 @ 00:27 UTC</p>
+ <p>Modified: Fri, May 05, 2023 @ 08:37 UTC</p>
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
+<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
</div>
</div>
diff --git a/live/blog/index.html b/live/blog/index.html
index 6183fee..3e9f993 100644
--- a/live/blog/index.html
+++ b/live/blog/index.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Index -- Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Index -- Luevano's Blog</h1>
<p>Welcome to my blog where I'll post whatever I please, ranging from rants to how-to's. Además, este pex va a estar en español e inglés porque quiero (no una mezcla en cada entrada, pero sí entradas completas en diferentes lenguajes).</p>
@@ -74,7 +81,7 @@
<div class="article-tags">
<p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@gamejam.html">gamejam</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a>, <a href="https://blog.luevano.xyz/tag/@rant.html">rant</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
+<a href="https://blog.luevano.xyz/tag/@code.html">code</a>, <a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@gamejam.html">gamejam</a>, <a href="https://blog.luevano.xyz/tag/@gdscript.html">gdscript</a>, <a href="https://blog.luevano.xyz/tag/@godot.html">godot</a>, <a href="https://blog.luevano.xyz/tag/@rant.html">rant</a>, <a href="https://blog.luevano.xyz/tag/@server.html">server</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a>, <a href="https://blog.luevano.xyz/tag/@spanish.html">spanish</a>, <a href="https://blog.luevano.xyz/tag/@tools.html">tools</a>, <a href="https://blog.luevano.xyz/tag/@tutorial.html">tutorial</a>, <a href="https://blog.luevano.xyz/tag/@update.html">update</a> </p>
</div>
@@ -96,7 +103,7 @@
<li>Aug 01 - <a href="https://blog.luevano.xyz/a/vpn_server_with_openvpn.html">Create a VPN server with OpenVPN (IPv4)</a></li>
<h3>July 2021</h3>
<li>Jul 28 - <a href="https://blog.luevano.xyz/a/hoy_toco_desarrollo_personaje.html">Hoy me tocó desarrollo de personaje</a></li>
- <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenia este pex algo descuidado</a></li>
+ <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenía este pex algo descuidado</a></li>
<h3>June 2021</h3>
<li>Jun 09 - <a href="https://blog.luevano.xyz/a/xmpp_server_with_prosody.html">Create an XMPP server with Prosody compatible with Conversations and Movim</a></li>
<li>Jun 06 - <a href="https://blog.luevano.xyz/a/acomodada_la_pagina_de_arte.html">Al fin ya me acomodé la página pa' los dibujos</a></li>
diff --git a/live/blog/rss.xml b/live/blog/rss.xml
index ef21a4e..dd6e44a 100644
--- a/live/blog/rss.xml
+++ b/live/blog/rss.xml
@@ -32,7 +32,7 @@
<category>Tools</category>
<category>Update</category>
<description>Rewrote pyssg to make it more flexible and to work with YAML configuration files.</description>
- <content:encoded><![CDATA[<p>I&rsquo;ve been wanting to change the way <a href="https://github.com/luevano/pyssg">pyssg</a> reads config files and generates <code>HTML</code> files so that it is more flexible and I don&rsquo;t need to have 2 separate build commands and configs (for <a href="https://blog.luevano.xyz">blog</a> and <a href="https://art.luevano.xyz">art</a>), and also to handle other types of &ldquo;sites&rdquo;; because <code>pyssg</code> was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of <em>rewrite</em> <code>pyssg</code>, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.</p>
+ <content:encoded><![CDATA[<p>I&rsquo;ve been wanting to change the way <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> reads config files and generates <code>HTML</code> files so that it is more flexible and I don&rsquo;t need to have 2 separate build commands and configs (for <a href="https://blog.luevano.xyz">blog</a> and <a href="https://art.luevano.xyz">art</a>), and also to handle other types of &ldquo;sites&rdquo;; because <code>pyssg</code> was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of <em>rewrite</em> <code>pyssg</code>, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.</p>
<p>Anyways, so I bought a new domain for all <code>pyssg</code> related stuff, mostly because I wanted somewhere to test live builds while developing, it is of course <a href="https://pyssg.xyz">pyssg.xyz</a>; as of now it is the same template, CSS and scripts that I use here, probably will change in the future. I&rsquo;ll be testing new features and anything <code>pyssg</code> related stuff.</p>
<p>I should start pointing all links to <code>pyssg</code> to the actual site instead of the github repository (or my <a href="https://git.luevano.xyz">git</a> repository), but I haven&rsquo;t decided how to handle everything.</p>]]></content:encoded>
</item>
@@ -44,35 +44,66 @@
<category>English</category>
<category>Gamedev</category>
<category>Gamejam</category>
+ <category>Gdscript</category>
<category>Godot</category>
<description>Details on the implementation for the game I created for the Go Godot Jam 3, which theme is Evolution.</description>
- <content:encoded><![CDATA[<p>The jam&rsquo;s theme is Evolution and all the details are listed <a href="https://itch.io/jam/go-godot-jam-3">here</a>. <del>This time I&rsquo;m logging as I go, so there might be some changes to the script or scenes along the way</del> <ins>I couldn&rsquo;t actually do this, as I was running out of time.</ins>. Note that I&rsquo;m not going to go into much details, the obvious will be ommitted.</p>
+ <content:encoded><![CDATA[<p>The jam&rsquo;s theme is Evolution and all the details are listed <a href="https://itch.io/jam/go-godot-jam-3">here</a>. <del>This time I&rsquo;m logging as I go, so there might be some changes to the script or scenes along the way.</del> <ins>I couldn&rsquo;t actually do this, as I was running out of time</ins>. Note that I&rsquo;m not going to go into much details, the obvious will be ommitted.</p>
<p>I wanted to do a <em>Snake</em> clone, and I&rsquo;m using this jam as an excuse to do it and add something to it. The features include:</p>
<ul>
<li>Snakes will pass their stats in some form to the next snakes.</li>
<li>Non-grid snake movement. I just hate the grid constraint, so I wanted to make it move in any direction.</li>
-<li>Depending on the food you eat, you&rsquo;ll gain new mutations/abilities <del>and the more you eat the more that mutation develops.</del> <ins>didn&rsquo;t have time to add this feature, sad.</ins></li>
+<li>Depending on the food you eat, you&rsquo;ll gain new mutations/abilities <del>and the more you eat the more that mutation develops</del> <ins>didn&rsquo;t have time to add this feature, sad</ins>.</li>
<li>Procedural map creation.</li>
</ul>
-<p>I created this game using <em>Godot 3.5-rc3</em>. You can find the source code in my GitHub <a href="https://github.com/luevano/gogodot_jam3">here</a> which at the time of writing this it doesn&rsquo;t contain any exported files, for that you can go ahead and play it in your browser at itch.io, which you can find below:</p>
-<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
+<p>I created this game using <em>Godot 3.5-rc3</em>. You can find the source code in my GitHub <a href="https://github.com/luevano/gogodot_jam3">here</a> which at the time of writing this it doesn&rsquo;t contain any exported files, for that you can go ahead and play it in your browser at <a href="https://lorentzeus.itch.io/snake-tronic">itch.io</a>, which you can find below:</p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
<p>You can also find the jam entry <a href="https://itch.io/jam/go-godot-jam-3/rate/1562701">here</a>.</p>
<p>Similarly with the my FlappyBird clone, I plan to update this to a better state.</p>
-<h3 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h3>
-<p>Again, similar to the <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">FlappyBird</a> clone I developed, I&rsquo;m using the directory structure I wrote about on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> with slight modifications to test things out. Also using similar <em>Project settings</em> as those from the <em>FlappyBird</em> clone like the pixel art texture imports, keybindings, layers, etc..</p>
-<p>I&rsquo;ve also setup <a href="https://github.com/bram-dingelstad/godot-gifmaker">GifMaker</a>, with slight modifications as the <em>AssetLib</em> doesn&rsquo;t install it correctly and contains unnecessry stuff: moved necessary files to the <code>res://addons</code> directory, deleted test scenes and files in general, and copied the license to the <code>res://docs</code> directory. Setting this up was a bit annoying because the tutorial it&rsquo;s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn&rsquo;t find it anywhere other than by inspecting some of the code/scenes.<ins>I ended up not leaving this enabled in the game as it lagged the game out, but it&rsquo;s an option I&rsquo;ll end up researching more.</ins></p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#initial-setup">Initial setup</a></li>
+<li><a href="#assets">Assets</a></li>
+<li><a href="#the-snake">The snake</a><ul>
+<li><a href="#basic-movement">Basic movement</a></li>
+<li><a href="#setting-up-path-following">Setting up path following</a></li>
+<li><a href="#define-body-parts-for-the-snake">Define body parts for the snake</a></li>
+<li><a href="#adding-body-parts">Adding body parts</a></li>
+<li><a href="#fix-on-body-segments-following-head">Fix on body segments following head</a></li>
+</ul>
+</li>
+<li><a href="#the-food">The food</a></li>
+<li><a href="#za-warudo-the-world">Za warudo! (The world)</a><ul>
+<li><a href="#food-placement">Food placement</a></li>
+</ul>
+</li>
+<li><a href="#stats-clas-and-loadingsaving-data">Stats clas and loading/saving data</a><ul>
+<li><a href="#stats-class">Stats class</a></li>
+<li><a href="#loadsave-data">Load/save data</a></li>
+</ul>
+</li>
+<li><a href="#scoring">Scoring</a></li>
+<li><a href="#snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern</a></li>
+<li><a href="#other-minor-stuff">Other minor stuff</a></li>
+<li><a href="#final-notes">Final notes</a></li>
+</ul>
+</div>
+<h2 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h2>
+<p>Again, similar to the <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">FlappyBird</a> clone I created, I&rsquo;m using the directory structure I wrote about on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> with slight modifications to test things out. Also using similar <em>Project settings</em> as those from the <em>FlappyBird</em> clone like the pixel art texture imports, keybindings, layers, etc..</p>
+<p>I&rsquo;ve also setup <a href="https://github.com/bram-dingelstad/godot-gifmaker">GifMaker</a>, with slight modifications as the <em>AssetLib</em> doesn&rsquo;t install it correctly and contains unnecessry stuff: moved necessary files to the <code>res://addons</code> directory, deleted test scenes and files in general, and copied the license to the <code>res://docs</code> directory. Setting this up was a bit annoying because the tutorial it&rsquo;s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn&rsquo;t find it anywhere other than by inspecting some of the code/scenes. <ins>I ended up leaving this disabled in the game as it hit the performance by a lot, but it&rsquo;s an option I&rsquo;ll end up researching more</ins>.</p>
<p>This time I&rsquo;m also going to be using an <a href="https://www.gdquest.com/docs/guidelines/best-practices/godot-gdscript/event-bus/">Event bus</a> singleton (which I&rsquo;m going to just call <em>Event</em>) as managing signals was pretty annoying on my last project; as well as a <em>Global</em> singleton for essential stuff so I don&rsquo;t have to do as many cross references between nodes/scenes.</p>
-<h3 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h3>
+<h2 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h2>
<p>This time I&rsquo;ll be creating my own assets in <a href="https://www.aseprite.org/">Aseprite</a>, wont be that good, but enough to prototype and get things going.</p>
<p>Other than that I used few key sprites from <a href="https://vryell.itch.io/">vryell</a>: <a href="https://vryell.itch.io/controller-keyboard-icons">Controller &amp; Keyboard Icons</a> and a font from <a href="https://datagoblin.itch.io/">datagoblin</a>: <a href="https://datagoblin.itch.io/monogram">Monogram</a>.</p>
-<h3 id="the-snake">The snake<a class="headerlink" href="#the-snake" title="Permanent link">&para;</a></h3>
+<h2 id="the-snake">The snake<a class="headerlink" href="#the-snake" title="Permanent link">&para;</a></h2>
<p>This is the most challenging part in my opinion as making all the body parts follow the head in a user defined path it&rsquo;s kinda hard. I tried with like 4-5 options and the one I&rsquo;m detailing here is the only one that worked as I wanted for me. This time the directory structure I&rsquo;m using is the following:</p>
<figure id="__yafg-figure-32">
-<img alt="FileSystem - Snake dir structure" src="images/g/gogodot_jam3/file_system_snake_dir_structure.png" title="FileSystem - Snake dir structure">
+<img alt="FileSystem - Snake dir structure" src="https://static.luevano.xyz/images/g/gogodot_jam3/file_system_snake_dir_structure.png" title="FileSystem - Snake dir structure">
<figcaption>FileSystem - Snake dir structure</figcaption>
</figure>
-<h4 id="basic-movement">Basic movement<a class="headerlink" href="#basic-movement" title="Permanent link">&para;</a></h4>
+<h3 id="basic-movement">Basic movement<a class="headerlink" href="#basic-movement" title="Permanent link">&para;</a></h3>
<p>The most basic thing is to move the head, this is what we have control of. Create a scene called <code>Head.tscn</code> and setup the basic <em>KinematicBody2D</em> with it&rsquo;s own <em>Sprite</em> and <em>CollisionShape2D</em> (I used a small circle for the tip of the head), and set the <em>Collision Layer/Mask</em> accordingly, for now just <code>layer = bit 1</code>. And all we need to do, is keep moving the snake forwards and be able to rotate left or right. Created a new script called <code>head.gd</code> attached to the root (<em>KinematicBody2D</em>) and added:</p>
<pre><code class="language-gdscript">extends KinematicBody2D
@@ -103,10 +134,10 @@ func _rotate_to(direction: int) -&gt; void:
</code></pre>
<p>After tunning all the necessary parameters you should get something like this:</p>
<figure id="__yafg-figure-33">
-<img alt="Snake - Basic movement (left and right controls)" src="images/g/gogodot_jam3/snake_basic_movement.gif" title="Snake - Basic movement (left and right controls)">
+<img alt="Snake - Basic movement (left and right controls)" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement.gif" title="Snake - Basic movement (left and right controls)">
<figcaption>Snake - Basic movement (left and right controls)</figcaption>
</figure>
-<h4 id="setting-up-path-following">Setting up path following<a class="headerlink" href="#setting-up-path-following" title="Permanent link">&para;</a></h4>
+<h3 id="setting-up-path-following">Setting up path following<a class="headerlink" href="#setting-up-path-following" title="Permanent link">&para;</a></h3>
<p>To move other snake parts by following the snake head the only solution I found was to use the <em>Path2D</em> and <em>PathFollow2D</em> nodes. <em>Path2D</em> basically just handles the curve/path that <em>PathFollow2D</em> will use to move its child node; and I say &ldquo;child node&rdquo; in singular&hellip; as <em>PathFollow2D</em> can only handle one damn child, all the other ones will have weird transformations and/or rotations. So, the next thing to do is to setup a way to compute (and draw so we can validate) the snake&rsquo;s path/curve.</p>
<p>Added the signal <code>snake_path_new_point(coordinates)</code> to the <em>Event</em> singleton and then add the following to <code>head.gd</code>:</p>
<pre><code class="language-gdscript">var _time_elapsed: float = 0.0
@@ -140,10 +171,10 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -&gt; void:
</code></pre>
<p>With this, we&rsquo;re now populating the <em>Path2D</em> curve points with the position of the snake head. You should be able to see it because of the <code>_draw</code> call. If you run it you should see something like this:</p>
<figure id="__yafg-figure-34">
-<img alt="Snake - Basic movement with path" src="images/g/gogodot_jam3/snake_basic_movement_with_path.gif" title="Snake - Basic movement with path">
+<img alt="Snake - Basic movement with path" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_path.gif" title="Snake - Basic movement with path">
<figcaption>Snake - Basic movement with path</figcaption>
</figure>
-<h4 id="define-body-parts-for-the-snake">Define body parts for the snake<a class="headerlink" href="#define-body-parts-for-the-snake" title="Permanent link">&para;</a></h4>
+<h3 id="define-body-parts-for-the-snake">Define body parts for the snake<a class="headerlink" href="#define-body-parts-for-the-snake" title="Permanent link">&para;</a></h3>
<p>At this point the only thing to do is to add the corresponding next body parts and tail of the snake. To do so, we need a <em>PathFollow2D</em> to use the live-generating <em>Path2D</em>, the only caveat is that we need one of these per body part/tail (this took me hours to figure out, <em>thanks documentation</em>).</p>
<p>Create a new scene called <code>Body.tscn</code> with a <em>PathFollow2D</em> as its root and an <em>Area2D</em> as its child, then just add the necessary <em>Sprite</em> and <em>CollisionShap2D</em> for the <em>Area2D</em>, I&rsquo;m using <code>layer = bit 2</code> for its collision. Create a new script called <code>generic_segment.gd</code> with the following code:</p>
<pre><code class="language-gdscript">extends PathFollow2D
@@ -155,7 +186,7 @@ func _physics_process(delta: float) -&gt; void:
offset += Global.SNAKE_SPEED * delta
</code></pre>
<p>And this can be attached to the <em>Body</em>&lsquo;s root node (<em>PathFollow2D</em>), no extra setup needed. Repeat the same steps for creating the <code>Tail.tscn</code> scene and when attaching the <code>generic_segment.gd</code> script just configure the <code>Type</code> parameter to <code>tail</code> in the GUI (by selecting the node with the script attached and editing in the <em>Inspector</em>).</p>
-<h4 id="adding-body-parts">Adding body parts<a class="headerlink" href="#adding-body-parts" title="Permanent link">&para;</a></h4>
+<h3 id="adding-body-parts">Adding body parts<a class="headerlink" href="#adding-body-parts" title="Permanent link">&para;</a></h3>
<p>Now it&rsquo;s just a matter of handling when to add new body parts in the <code>snake.gd</code> script. For now I&rsquo;ve only setup for adding body parts to fulfill the initial length of the snake (this doesn&rsquo;t include the head or tail). The extra code needed is the following:</p>
<pre><code class="language-gdscript">export(PackedScene) var BODY_SEGMENT_NP: PackedScene
export(PackedScene) var TAIL_SEGMENT_NP: PackedScene
@@ -184,7 +215,7 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -&gt; void:
</code></pre>
<p>Select the <em>Snake</em> node and add the <em>Body</em> and <em>Tail</em> scene to the parameters, respectively. Then when running you should see something like this:</p>
<figure id="__yafg-figure-35">
-<img alt="Snake - Basic movement with all body parts" src="images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif" title="Snake - Basic movement with all body parts">
+<img alt="Snake - Basic movement with all body parts" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif" title="Snake - Basic movement with all body parts">
<figcaption>Snake - Basic movement with all body parts</figcaption>
</figure>
<p>Now, we need to handle adding body parts after the snake is complete and already moved for a bit, this will require a queue so we can add part by part in the case that we eat multiple pieces of food in a short period of time. For this we need to add some signals: <code>snake_adding_new_segment(type)</code>, <code>snake_added_new_segment(type)</code>, <code>snake_added_initial_segments</code> and use them when makes sense. Now we need to add the following:</p>
@@ -225,9 +256,9 @@ func _add_segment_to_queue() -&gt; void:
else:
body_segment_queue.append(body_segment_queue.back() + Global.SNAKE_SEGMENT_SIZE)
</code></pre>
-<p>With everything implemented and connected accordingly then we can add segments on demand (for testing I&rsquo;m adding with a keystroke), it should look like this:</p>
+<p>With everything implemented and connected accordingly then we can add segments on demand (for testing I&rsquo;m adding with a key press), it should look like this:</p>
<figure id="__yafg-figure-36">
-<img alt="Snake - Basic movement with dynamic addition of new segments" src="images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif" title="Snake - Basic movement with dynamic addition of new segments">
+<img alt="Snake - Basic movement with dynamic addition of new segments" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif" title="Snake - Basic movement with dynamic addition of new segments">
<figcaption>Snake - Basic movement with dynamic addition of new segments</figcaption>
</figure>
<p>For now, this should be enough, I&rsquo;ll add more stuff as needed as I go. Last thing is that after finished testing that the movement felt ok, I just added a way to stop the snake whenever it collides with itself by using the following code (and the signal <code>snake_segment_body_entered(body)</code>) in a <code>main.gd</code> script that is the entry point for the game:</p>
@@ -239,13 +270,13 @@ func _add_segment_to_queue() -&gt; void:
_snake.propagate_call(&quot;set_process_input&quot;, [on_off])
</code></pre>
<p>Which will stop the snake node and all children.</p>
-<h4 id="fix-on-body-segments-following-head">Fix on body segments following head<a class="headerlink" href="#fix-on-body-segments-following-head" title="Permanent link">&para;</a></h4>
+<h3 id="fix-on-body-segments-following-head">Fix on body segments following head<a class="headerlink" href="#fix-on-body-segments-following-head" title="Permanent link">&para;</a></h3>
<p>After a while of testing and developing, I noticed that sometimes the head &ldquo;detaches&rdquo; from the body when a lot of rotations happen (moving the snake left or right), because of how imprecise the <em>Curve2D</em> is. To do this I just send a signal (<code>snake_rotated</code>) whenever the snake rotates and make a small correction (in <code>generic_segment.gd</code>):</p>
<pre><code class="language-gdscript">func _on_snake_rotated() -&gt; void:
offset -= 0.75 * Global.SNAKE_SPEED * pow(get_physics_process_delta_time(), 2)
</code></pre>
<p>This is completely random, I tweaked it manually after a lot of iterations.</p>
-<h3 id="the-food">The food<a class="headerlink" href="#the-food" title="Permanent link">&para;</a></h3>
+<h2 id="the-food">The food<a class="headerlink" href="#the-food" title="Permanent link">&para;</a></h2>
<p>For now I just decided to setup a simple system to see everything works fine. The idea is to make some kind of generic food node/scene and a &ldquo;food manager&rdquo; to spawn them, for now in totally random locations. For this I added the following signals: <code>food_placing_new_food(type)</code>, <code>food_placed_new_food(type)</code> and <code>food_eaten(type)</code>.</p>
<p>First thing is creating the <code>Food.tscn</code> which is just an <em>Area2D</em> with its necessary children with an attached script called <code>food.gd</code>. The script is really simple:</p>
<pre><code class="language-gdscript">class_name Food # needed to access Type enum outside of the script, this registers this script as a node
@@ -290,21 +321,21 @@ func _on_body_entered(body: Node) -&gt; void:
</code></pre>
<p>And this is used in <code>_process</code> to place new food whenever needed. For now I added a condition to add food until 10 pieces are in place, and keep adding whenever the food is is lower than 10. After setting everything up, this is the result:</p>
<figure id="__yafg-figure-37">
-<img alt="Snake - Food basic interaction" src="images/g/gogodot_jam3/snake_food_basic_interaction.gif" title="Snake - Food basic interaction">
+<img alt="Snake - Food basic interaction" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_food_basic_interaction.gif" title="Snake - Food basic interaction">
<figcaption>Snake - Food basic interaction</figcaption>
</figure>
-<h3 id="za-warudo-the-world">Za warudo! (The world)<a class="headerlink" href="#za-warudo-the-world" title="Permanent link">&para;</a></h3>
+<h2 id="za-warudo-the-world">Za warudo! (The world)<a class="headerlink" href="#za-warudo-the-world" title="Permanent link">&para;</a></h2>
<p>It just happend that I saw a video to create random maps by using a method called <a href="https://www.mit.edu/~kardar/teaching/projects/chemotaxis(AndreaSchmidt)/random.htm">random walks</a>, this video was made by <a href="https://www.youtube.com/c/NADLABS">NAD LABS</a>: <a href="https://www.youtube.com/watch?v=ppP2Doq3p7s">Nuclear Throne Like Map Generation In Godot</a>. It&rsquo;s a pretty simple but powerful script, he provided the source code from which I based my random walker, just tweaked a few things and added others. Some of the maps than can be generated with this method (already aded some random sprites):</p>
<figure id="__yafg-figure-38">
-<img alt="World map generator - Random map 1" src="images/g/gogodot_jam3/world_generator_1.png" title="World map generator - Random map 1">
+<img alt="World map generator - Random map 1" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_1.png" title="World map generator - Random map 1">
<figcaption>World map generator - Random map 1</figcaption>
</figure>
<figure id="__yafg-figure-39">
-<img alt="World map generator - Random map 2" src="images/g/gogodot_jam3/world_generator_2.png" title="World map generator - Random map 2">
+<img alt="World map generator - Random map 2" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_2.png" title="World map generator - Random map 2">
<figcaption>World map generator - Random map 2</figcaption>
</figure>
<figure id="__yafg-figure-40">
-<img alt="World map generator - Random map 3" src="images/g/gogodot_jam3/world_generator_3.png" title="World map generator - Random map 3">
+<img alt="World map generator - Random map 3" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_3.png" title="World map generator - Random map 3">
<figcaption>World map generator - Random map 3</figcaption>
</figure>
<p>It started with just black and white tiles, but I ended up adding some sprites as it was really harsh to the eyes. My implementation is basically the same as <em>NAD LABS</em>&lsquo; with few changes, most importantly: I separated the generation in 2 diferent tilemaps (floor and wall) to have better control as well as wrapped everything in a single scene with a &ldquo;main&rdquo; script with the following important functions:</p>
@@ -321,7 +352,7 @@ func get_centered_world_position(location: Vector2) -&gt; Vector2:
</code></pre>
<p>Where <code>get_cells_around</code> is just a function that gets the safe cells around the origin. And this <code>get_valid_map_coords</code> just returns used cells minus the safe cells, to place food. <code>get_centered_world_position</code> is so we can center the food in the tiles.</p>
<p>Some signals I used for the world gen: <code>world_gen_walker_started(id)</code>, <code>world_gen_walker_finished(id)</code>, <code>world_gen_walker_died(id)</code> and <code>world_gen_spawn_walker_unit(location)</code>.</p>
-<h4 id="food-placement">Food placement<a class="headerlink" href="#food-placement" title="Permanent link">&para;</a></h4>
+<h3 id="food-placement">Food placement<a class="headerlink" href="#food-placement" title="Permanent link">&para;</a></h3>
<p>The last food algorithm doesn&rsquo;t check anything related to the world, and thus the food could spawn in the walls and outside the map.</p>
<p>First thing is I generalized the food into a single script and added basic food and special food which inherit from base food. The most important stuff for the base food is to be able to set all necessary properties at first:</p>
<pre><code class="language-gdscript">func update_texture() -&gt; void:
@@ -371,10 +402,10 @@ func _ready():
return [world_generator.get_centered_world_position(location), location]
</code></pre>
<p>Other than that, there are some differences between placing normal and special food (specially the signal they send, and if an extra &ldquo;special points&rdquo; property is set). Some of the signals that I used that might be important: <code>food_placing_new_food(type)</code>, <code>food_placed_new_food(type, location)</code> and <code>food_eaten(type, location)</code>.</p>
-<h3 id="stats-clas-and-loadingsaving-data">Stats clas and loading/saving data<a class="headerlink" href="#stats-clas-and-loadingsaving-data" title="Permanent link">&para;</a></h3>
-<p>I got the idea of saving the current stats (points, max body segments, etc.) in a separate <em>Stats</em> class for easier load/save data. This option I went with didn&rsquo;t work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions&hellip; so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving <code>tres</code> files).</p>
-<h4 id="stats-class">Stats class<a class="headerlink" href="#stats-class" title="Permanent link">&para;</a></h4>
-<p>The <em>Stats</em> &ldquo;class&rdquo; is just a script that extends from <em>Node</em> called <code>stats.gd</code>. It needs to define the <code>class_name</code> as <code>Stats</code>. The main content:</p>
+<h2 id="stats-clas-and-loadingsaving-data">Stats clas and loading/saving data<a class="headerlink" href="#stats-clas-and-loadingsaving-data" title="Permanent link">&para;</a></h2>
+<p>I got the idea of saving the current stats (points, max body segments, etc.) in a separate <code>Stats</code> class for easier load/save data. This option I went with didn&rsquo;t work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions&hellip; so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving <code>tres</code> files).</p>
+<h3 id="stats-class">Stats class<a class="headerlink" href="#stats-class" title="Permanent link">&para;</a></h3>
+<p>The <code>Stats</code> &ldquo;class&rdquo; is just a script that extends from <em>Node</em> called <code>stats.gd</code>. It needs to define the <code>class_name</code> as <code>Stats</code>. The main content:</p>
<pre><code class="language-gdscript"># main
var points: int = 0
var segments: int = 0
@@ -436,8 +467,8 @@ func set_stats(stats: Dictionary) -&gt; void:
trait_jump = stats[&quot;trait_jump&quot;]
</code></pre>
<p>And this is not scalable at all, but I had to do this at the end of the jam so no way of optimizing and/or doing it correctly, sadly.</p>
-<h4 id="loadsave-data">Load/save data<a class="headerlink" href="#loadsave-data" title="Permanent link">&para;</a></h4>
-<p>The load/save function is pretty standard. It&rsquo;s a singleton/autoload called <em>SavedData</em> with a script that extends from <em>Node</em> called <code>save_data.gd</code>:</p>
+<h3 id="loadsave-data">Load/save data<a class="headerlink" href="#loadsave-data" title="Permanent link">&para;</a></h3>
+<p>The load/save function is pretty standard. It&rsquo;s a singleton/autoload called <code>SavedData</code> with a script that extends from <em>Node</em> called <code>save_data.gd</code>:</p>
<pre><code class="language-gdscript">const DATA_PATH: String = &quot;user://data.save&quot;
var _stats: Stats
@@ -479,9 +510,9 @@ func _handle_new_file() -&gt; void:
file.store_line(to_json(_stats.get_stats()))
file.close()
</code></pre>
-<p>It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (<em>Stats</em> class related issues).</p>
-<h3 id="scoring">Scoring<a class="headerlink" href="#scoring" title="Permanent link">&para;</a></h3>
-<p>For this I created a scoring mechanisms and just called it <em>ScoreManager</em> (<code>score_manager.gd</code>) which just basically listens to <code>food_eaten</code> signal and adds points accordingly to the current <em>Stats</em> object loaded. The main function is:</p>
+<p>It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (<code>Stats</code> class related issues).</p>
+<h2 id="scoring">Scoring<a class="headerlink" href="#scoring" title="Permanent link">&para;</a></h2>
+<p>For this I created a scoring mechanisms and just called it <code>ScoreManager</code> (<code>score_manager.gd</code>) which just basically listens to <code>food_eaten</code> signal and adds points accordingly to the current <em>Stats</em> object loaded. The main function is:</p>
<pre><code class="language-gdscript">func _on_food_eaten(properties: Dictionary) -&gt; void:
var is_special: bool = properties[&quot;special&quot;]
var type: int = properties[&quot;type&quot;]
@@ -521,7 +552,7 @@ func _handle_new_file() -&gt; void:
</code></pre>
<p>Which will add the necessary points to <code>Stats.points</code> and return the amount of new snake segments to grow. After this <code>_spawn_added_score_segment</code> and <code>_spawn_added_segment_text</code> just spawn a <em>Label</em> with the info on the points/segments gained; this is custom UI I created, nothing fancy.</p>
<p>Last thing is taht in <code>_process_points</code> there is a check at the end, where if the food eaten is &ldquo;special&rdquo; then a custom variation of the last 3 functions are executed. These are really similar, just specific to each kind of food.</p>
-<p>This <em>ScoreManager</em> also handles the calculation for the <code>game_over</code> signal, to calculte progress, set necessary <em>Stats</em> values and save the data:</p>
+<p>This <code>ScoreManager</code> also handles the calculation for the <code>game_over</code> signal, to calculte progress, set necessary <code>Stats</code> values and save the data:</p>
<pre><code class="language-gdscript">func _on_game_over() -&gt; void:
var max_stats: Stats = _get_max_stats()
SaveData.save_data(max_stats)
@@ -548,8 +579,8 @@ func _get_max_stats() -&gt; Stats:
return max_stats
</code></pre>
<p>Then this sends a signal <code>display_stats</code> to activate UI elements that shows the progression.</p>
-<p>Naturally, the saved <em>Stats</em> are loaded whenever needed. For example, for the <em>Snake</em>, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we&rsquo;re saving the new <em>Stats</em> at the end, then on restart we load the updated one.</p>
-<h3 id="snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern<a class="headerlink" href="#snake-redesigned-with-the-state-machine-pattern" title="Permanent link">&para;</a></h3>
+<p>Naturally, the saved <code>Stats</code> are loaded whenever needed. For example, for the <code>Snake</code>, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we&rsquo;re saving the new <code>Stats</code> at the end, then on restart we load the updated one.</p>
+<h2 id="snake-redesigned-with-the-state-machine-pattern">Snake redesigned with the state machine pattern<a class="headerlink" href="#snake-redesigned-with-the-state-machine-pattern" title="Permanent link">&para;</a></h2>
<p>I redesigned the snake code (the head, actually) to use the state machine pattern by following <a href="https://gdscript.com/solutions/godot-state-machine/">this guide</a> which is definitely a great guide, straight to the point and easy to implement.</p>
<p>Other than what is shown in the guide, I implemented some important functions in the <code>state_machine.gd</code> script itself, to be used by each of the states as needed:</p>
<pre><code class="language-gdscript">func rotate_on_input() -&gt; void:
@@ -571,7 +602,7 @@ func handle_slow_speeds() -&gt; void:
Global.SNAKE_SPEED = Global.SNAKE_SPEED_BACKUP
Event.emit_signal(&quot;game_over&quot;)
</code></pre>
-<p>And then in the <em>StateMachine</em>&lsquo;s <code>_process</code>:</p>
+<p>And then in the <code>StateMachine</code>&lsquo;s <code>_process</code>:</p>
<pre><code class="language-gdscript">func _physics_process(delta: float) -&gt; void:
# state specific code, move_and_slide is called here
if state.has_method(&quot;physics_process&quot;):
@@ -623,7 +654,7 @@ func physics_process(delta: float) -&gt; void:
</code></pre>
<p>Where the important parts happen in the <code>enter</code> and <code>exit</code> functions. We need to change the <code>Global.SNAKE_SPEED</code> with the <code>Global.SNAKE_DASH_SPEED</code> on <code>start</code>and start the timer for how long should the dash last. And on the <code>exit</code> we reset the <code>Global.SNAKE_SPEED</code> back to normal. There is probably a better way of updating the <code>Global.SNAKE_SPEED</code> but this works just fine.</p>
<p>For the other ones is the same. Only difference with the <code>jump_state.gd</code> is that the collision from head to body is disabled, and no rotation is allowed (by not calling the <code>rotate_on_input</code> function).</p>
-<h3 id="other-minor-stuff">Other minor stuff<a class="headerlink" href="#other-minor-stuff" title="Permanent link">&para;</a></h3>
+<h2 id="other-minor-stuff">Other minor stuff<a class="headerlink" href="#other-minor-stuff" title="Permanent link">&para;</a></h2>
<p>Not as important but worth mentioning:</p>
<ul>
<li>Added restartability function.</li>
@@ -637,9 +668,9 @@ func physics_process(delta: float) -&gt; void:
<li>Refactored the nodes to make it work with <code>change_scene_to</code>, and added a main menu.</li>
<li>Added GUI for dead screen, showing the progress.</li>
</ul>
-<h3 id="final-notes">Final notes<a class="headerlink" href="#final-notes" title="Permanent link">&para;</a></h3>
-<p>I actually didn&rsquo;t finish this game (as how I visualized it), but I got it in a playable state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.</p>
-<p>For exporting and everything else, I went with what I did for my <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting">FlappyBird Godot clone</a></p>]]></content:encoded>
+<h2 id="final-notes">Final notes<a class="headerlink" href="#final-notes" title="Permanent link">&para;</a></h2>
+<p>I actually didn&rsquo;t finish this game (as how I visualized it), but I got it in a <em>semi-playable</em> state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.</p>
+<p>For exporting and everything else, I went with what I did for my <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting">FlappyBird Godot clone: final notes and exporting</a></p>]]></content:encoded>
</item>
<item>
<title>Creating a FlappyBird clone in Godot 3.5 devlog 1</title>
@@ -648,9 +679,10 @@ func physics_process(delta: float) -&gt; void:
<pubDate>Sun, 29 May 2022 03:38:43 GMT</pubDate>
<category>English</category>
<category>Gamedev</category>
+ <category>Gdscript</category>
<category>Godot</category>
<description>Since I'm starting to get more into gamedev stuff, I'll start blogging about it just to keep consistent. This shows as "devlog 1" just in case I want to include more parts for extra stuff.</description>
- <content:encoded><![CDATA[<p>I just have a bit of experience with Godot and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:</p>
+ <content:encoded><![CDATA[<p>I just have a bit of experience with <em>Godot</em> and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:</p>
<ul>
<li>Literally just one sprite going up and down.</li>
<li>Constant horizontal move of the world/player.</li>
@@ -660,189 +692,246 @@ func physics_process(delta: float) -&gt; void:
<p>The game was originally developed with <em>Godot 4.0 alpha 8</em>, but it didn&rsquo;t support HTML5 (webassembly) export&hellip; so I backported to <em>Godot 3.5 rc1</em>.</p>
<p>Not going to specify all the details, only the needed parts and what could be confusing, as the source code is available and can be inspected; also this assumes minimal knowledge of <em>Godot</em> in general. Usually when I mention that a set/change of something it usually it&rsquo;s a property and it can be found under the <em>Inspector</em> on the relevant node, unless stated otherwise; also, all scripts attached have the same name as the scenes, but in <em>snake_case</em> (scenes/nodes in <em>PascalCase</em>).</p>
<p>One thing to note, is that I started writing this when I finished the game, so it&rsquo;s hard to go part by part, and it will be hard to test individual parts when going through this as everything is depending on each other. For the next devlog, I&rsquo;ll do it as I go and it will include all the changes to the nodes/scripts as I was finding them, probably better idea and easier to follow.</p>
-<p>The source code can be found in my GitHub <a href="https://github.com/luevano/flappybird_godot">here</a>, it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I&rsquo;m too lazy to make it configurable, it was the last thing I added), or you could also go to the itch.io page I setup where it&rsquo;s playable in the browser:</p>
-<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
+<p>The source code can be found in my GitHub <a href="https://github.com/luevano/flappybird_godot">here</a>, it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I&rsquo;m too lazy to make it configurable, it was the last thing I added), or you could also go to the <a href="https://lorentzeus.itch.io/flappybirdgodot">itch.io</a> page I setup where it&rsquo;s playable in the browser:</p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
-<h3 id="initial-project-setup">Initial project setup<a class="headerlink" href="#initial-project-setup" title="Permanent link">&para;</a></h3>
-<h4 id="directory-structure">Directory structure<a class="headerlink" href="#directory-structure" title="Permanent link">&para;</a></h4>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#initial-setup">Initial setup</a><ul>
+<li><a href="#directory-structure">Directory structure</a></li>
+<li><a href="#config">Config</a><ul>
+<li><a href="#default-import-settings">Default import settings</a></li>
+<li><a href="#general-settings">General settings</a></li>
+<li><a href="#keybindings">Keybindings</a></li>
+<li><a href="#layers">Layers</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#assets">Assets</a><ul>
+<li><a href="#importing">Importing</a></li>
+</ul>
+</li>
+<li><a href="#scenes">Scenes</a><ul>
+<li><a href="#tilemaps">TileMaps</a><ul>
+<li><a href="#default-ground-tiles">Default ground tiles</a></li>
+</ul>
+</li>
+<li><a href="#player">Player</a></li>
+<li><a href="#other">Other</a></li>
+<li><a href="#game">Game</a></li>
+<li><a href="#ui">UI</a><ul>
+<li><a href="#fonts">Fonts</a></li>
+<li><a href="#scene-setup">Scene setup</a></li>
+</ul>
+</li>
+<li><a href="#main">Main</a></li>
+</ul>
+</li>
+<li><a href="#scripting">Scripting</a><ul>
+<li><a href="#player_1">Player</a></li>
+<li><a href="#worlddetector">WorldDetector</a></li>
+<li><a href="#worldtiles">WorldTiles</a><ul>
+<li><a href="#groundtilemap">GroundTileMap</a></li>
+<li><a href="#pipetilemap">PipeTileMap</a></li>
+</ul>
+</li>
+<li><a href="#saved-data">Saved data</a></li>
+<li><a href="#game_1">Game</a></li>
+<li><a href="#ui_1">UI</a></li>
+<li><a href="#main_1">Main</a></li>
+</ul>
+</li>
+<li><a href="#final-notes-and-exporting">Final notes and exporting</a><ul>
+<li><a href="#preparing-the-files">Preparing the files</a></li>
+<li><a href="#exporting">Exporting</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="initial-setup">Initial setup<a class="headerlink" href="#initial-setup" title="Permanent link">&para;</a></h2>
+<h3 id="directory-structure">Directory structure<a class="headerlink" href="#directory-structure" title="Permanent link">&para;</a></h3>
<p>I&rsquo;m basically going with what I wrote on <a href="https://blog.luevano.xyz/g/godot_project_structure.html">Godot project structure</a> recently, and probably with minor changes depending on the situation.</p>
-<h4 id="config">Config<a class="headerlink" href="#config" title="Permanent link">&para;</a></h4>
-<h5 id="default-import-settings">Default import settings<a class="headerlink" href="#default-import-settings" title="Permanent link">&para;</a></h5>
+<h3 id="config">Config<a class="headerlink" href="#config" title="Permanent link">&para;</a></h3>
+<h4 id="default-import-settings">Default import settings<a class="headerlink" href="#default-import-settings" title="Permanent link">&para;</a></h4>
<p>Since this is just pixel art, the importing settings for textures needs to be adjusted so the sprites don&rsquo;t look blurry. Go to <em>Project -&gt; Project settings&hellip; -&gt; Import defaults</em> and on the drop down select <code>Texture</code>, untick everything and make sure <em>Compress/Mode</em> is set to <code>Lossless</code>.</p>
<figure id="__yafg-figure-4">
-<img alt="Project settings - Import defaults - Texture settings" src="images/g/flappybird_godot/project_settings_import_texture.png" title="Project settings - Import defaults - Texture settings">
+<img alt="Project settings - Import defaults - Texture settings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_import_texture.png" title="Project settings - Import defaults - Texture settings">
<figcaption>Project settings - Import defaults - Texture settings</figcaption>
</figure>
-<h5 id="general-settings">General settings<a class="headerlink" href="#general-settings" title="Permanent link">&para;</a></h5>
+<h4 id="general-settings">General settings<a class="headerlink" href="#general-settings" title="Permanent link">&para;</a></h4>
<p>It&rsquo;s also a good idea to setup some config variables project-wide. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Application/config</em> and add a new property (there is a text box at the top of the project settings window) for game scale: <code>application/config/game_scale</code> for the type use <code>float</code> and then click on add; configure the new property to <code>3.0</code>; On the same window, also add <code>application/config/version</code> as a <code>string</code>, and make it <code>1.0.0</code> (or whatever number you want).</p>
<figure id="__yafg-figure-5">
-<img alt="Project settings - General - Game scale and version properties" src="images/g/flappybird_godot/project_settings_config_properties.png" title="Project settings - General - Game scale and version properties">
+<img alt="Project settings - General - Game scale and version properties" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_config_properties.png" title="Project settings - General - Game scale and version properties">
<figcaption>Project settings - General - Game scale and version properties</figcaption>
</figure>
-<p>For my personal preferences, also disable some of the <em>GDScript</em> debug warnings that are annoying, this is done at <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Debug/GDScript</em> and toggle off &ldquo;Unused arguments&rdquo;, &ldquo;Unused signal&rdquo; and &ldquo;Return value discarded&rdquo;, and any other that might come up too often and don&rsquo;t want to see.</p>
+<p>For my personal preferences, also disable some of the <em>GDScript</em> debug warnings that are annoying, this is done at <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Debug/GDScript</em> and toggle off <code>Unused arguments</code>, <code>Unused signal</code> and <code>Return value discarded</code>, and any other that might come up too often and don&rsquo;t want to see.</p>
<figure id="__yafg-figure-6">
-<img alt="Project settings - General - GDScript debug warnings" src="images/g/flappybird_godot/project_settings_debug_gdscript.png" title="Project settings - General - GDScript debug warnings">
+<img alt="Project settings - General - GDScript debug warnings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_debug_gdscript.png" title="Project settings - General - GDScript debug warnings">
<figcaption>Project settings - General - GDScript debug warnings</figcaption>
</figure>
-<p>Finally, set the initial window size in <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Display/Window</em> and set <em>Size/Width</em> and <em>Size/Height</em> to <code>600</code> and <code>800</code>, respectively. As well as the <em>Stretch/Mode</em> to &ldquo;viewport&rdquo;, and <em>Stretch/Aspect</em> to &ldquo;keep&rdquo;:</p>
+<p>Finally, set the initial window size in <em>Project -&gt; Project settings&hellip; -&gt; General</em>, select <em>Display/Window</em> and set <em>Size/Width</em> and <em>Size/Height</em> to <code>600</code> and <code>800</code>, respectively. As well as the <em>Stretch/Mode</em> to <code>viewport</code> , and <em>Stretch/Aspect</em> to <code>keep</code>:</p>
<figure id="__yafg-figure-7">
-<img alt="Project settings - General - Initial window size" src="images/g/flappybird_godot/project_settings_window_settings.png" title="Project settings - General - Initial window size">
+<img alt="Project settings - General - Initial window size" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_window_settings.png" title="Project settings - General - Initial window size">
<figcaption>Project settings - General - Initial window size</figcaption>
</figure>
-<h5 id="keybindings">Keybindings<a class="headerlink" href="#keybindings" title="Permanent link">&para;</a></h5>
-<p>I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the <code>Input.something()</code> API can be used), go to <em>Project -&gt; Project settings&hellip; -&gt; Input Map</em> and on the text box write &ldquo;jump&rdquo; and click add, then it will be added to the list and it&rsquo;s just a matter of clicking the <code>+</code> sign to add a &ldquo;Physical key&rdquo;, press any key you want to be used to jump and click ok. Do the same for the rest of the actions.</p>
+<h4 id="keybindings">Keybindings<a class="headerlink" href="#keybindings" title="Permanent link">&para;</a></h4>
+<p>I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the <code>Input.something()</code> API can be used), go to <em>Project -&gt; Project settings&hellip; -&gt; Input Map</em> and on the text box write <code>jump</code> and click add, then it will be added to the list and it&rsquo;s just a matter of clicking the <code>+</code> sign to add a <em>Physical key</em>, press any key you want to be used to jump and click ok. Do the same for the rest of the actions.</p>
<figure id="__yafg-figure-8">
-<img alt="Project settings - Input Map - Adding necessary keybindings" src="images/g/flappybird_godot/project_settings_input_map.png" title="Project settings - Input Map - Adding necessary keybindings">
+<img alt="Project settings - Input Map - Adding necessary keybindings" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_input_map.png" title="Project settings - Input Map - Adding necessary keybindings">
<figcaption>Project settings - Input Map - Adding necessary keybindings</figcaption>
</figure>
-<h5 id="layers">Layers<a class="headerlink" href="#layers" title="Permanent link">&para;</a></h5>
-<p>Finally, rename the physics layers so we don&rsquo;t lose track of which layer is which. Go to <em>Project -&gt; Layer Names -&gt; 2d Physics</em> and change the first 5 layer names to (in order): &ldquo;player&rdquo;, &ldquo;ground&rdquo;, &ldquo;pipe&rdquo;, &ldquo;ceiling&rdquo; and &ldquo;score&rdquo;.</p>
+<h4 id="layers">Layers<a class="headerlink" href="#layers" title="Permanent link">&para;</a></h4>
+<p>Finally, rename the physics layers so we don&rsquo;t lose track of which layer is which. Go to <em>Project -&gt; Layer Names -&gt; 2d Physics</em> and change the first 5 layer names to (in order): <code>player</code>, <code>ground</code>, <code>pipe</code>, <code>ceiling</code> and <code>score</code>.</p>
<figure id="__yafg-figure-9">
-<img alt="Project settings - Layer Names - 2D Physics" src="images/g/flappybird_godot/project_settings_layer_names_2d_physics.png" title="Project settings - Layer Names - 2D Physics">
+<img alt="Project settings - Layer Names - 2D Physics" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png" title="Project settings - Layer Names - 2D Physics">
<figcaption>Project settings - Layer Names - 2D Physics</figcaption>
</figure>
-<h3 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h3>
+<h2 id="assets">Assets<a class="headerlink" href="#assets" title="Permanent link">&para;</a></h2>
<p>For the assets I found out about a pack that contains just what I need: <a href="https://megacrash.itch.io/flappy-bird-assets">flappy-bird-assets</a> by <a href="https://megacrash.itch.io/">MegaCrash</a>; I just did some minor modifications on the naming of the files. For the font I used <a href="https://poppyworks.itch.io/silver">Silver</a>, and for the sound the resources from <a href="https://github.com/meeq/FlappyBird-N64">FlappyBird-N64</a> (which seems to be taken from <a href="https://www.101soundboards.com/boards/10178-flappy-bird-sounds">101soundboards.com</a> which the orignal copyright holder is <a href="https://dotgears.com/">.Gears</a> anyways).</p>
-<h4 id="importing">Importing<a class="headerlink" href="#importing" title="Permanent link">&para;</a></h4>
-<p>Create the necessary directories to hold the respective assets and it&rsquo;s just a matter of dragging and dropping, I used directories: <code>res://entities/actors/player/sprites/</code>, <code>res://fonts/</code>, <code>res://levels/world/background/sprites/</code>, <code>res://levels/world/ground/sprites/</code>, <code>res://levels/world/pipe/sprites/</code>, <code>res://sfx/</code>. For the player sprites, the &ldquo;FileSystem&rdquo; window looks like this (<code>entities/actor</code> directories are really not necessary):</p>
+<h3 id="importing">Importing<a class="headerlink" href="#importing" title="Permanent link">&para;</a></h3>
+<p>Create the necessary directories to hold the respective assets and it&rsquo;s just a matter of dragging and dropping, I used directories: <code>res://entities/actors/player/sprites/</code>, <code>res://fonts/</code>, <code>res://levels/world/background/sprites/</code>, <code>res://levels/world/ground/sprites/</code>, <code>res://levels/world/pipe/sprites/</code>, <code>res://sfx/</code>. For the player sprites, the
+<em>FileSystem</em> window looks like this (<code>entities/actor</code> directories are really not necessary):</p>
<figure id="__yafg-figure-10">
-<img alt="FileSystem - Player sprite imports" src="images/g/flappybird_godot/player_sprite_imports.png" title="FileSystem - Player sprite imports">
+<img alt="FileSystem - Player sprite imports" src="https://static.luevano.xyz/images/g/flappybird_godot/player_sprite_imports.png" title="FileSystem - Player sprite imports">
<figcaption>FileSystem - Player sprite imports</figcaption>
</figure>
<p>It should look similar for other directories, except maybe for the file extensions. For example, for the sfx:</p>
<figure id="__yafg-figure-11">
-<img alt="FileSystem - SFX imports" src="images/g/flappybird_godot/sfx_imports.png" title="FileSystem - SFX imports">
+<img alt="FileSystem - SFX imports" src="https://static.luevano.xyz/images/g/flappybird_godot/sfx_imports.png" title="FileSystem - SFX imports">
<figcaption>FileSystem - SFX imports</figcaption>
</figure>
-<h3 id="scenes">Scenes<a class="headerlink" href="#scenes" title="Permanent link">&para;</a></h3>
+<h2 id="scenes">Scenes<a class="headerlink" href="#scenes" title="Permanent link">&para;</a></h2>
<p>Now it&rsquo;s time to actually create the game, by creating the basic scenes that will make up the game. The hardest part and the most confusing is going to be the <em>TileMaps</em>, so that goes first.</p>
-<h4 id="tilemaps">TileMaps<a class="headerlink" href="#tilemaps" title="Permanent link">&para;</a></h4>
-<p>I&rsquo;m using a scene called &ldquo;WorldTiles&rdquo; with a <em>Node2D</em> node as root called the same. With 2 different <em>TileMap</em> nodes as children named &ldquo;GroundTileMap&rdquo; and &ldquo;PipeTileMap&rdquo; (these are their own scene); yes 2 different <em>TileMaps</em> because we need 2 different physics colliders (In Godot 4.0 you can have a single <em>TileMap</em> with different physics colliders in it). Each node has its own script. It should look something like this:</p>
+<h3 id="tilemaps">TileMaps<a class="headerlink" href="#tilemaps" title="Permanent link">&para;</a></h3>
+<p>I&rsquo;m using a scene called <code>WorldTiles</code> with a <em>Node2D</em> node as root called the same. With 2 different <em>TileMap</em> nodes as children named <code>GroundTileMap</code> and <code>PipeTileMap</code> (these are their own scene); yes 2 different <em>TileMaps</em> because we need 2 different physics colliders (in <em>Godot 4.0</em> you can have a single <em>TileMap</em> with different physics colliders in it). Each node has its own script. It should look something like this:</p>
<figure id="__yafg-figure-12">
-<img alt="Scene - WorldTiles (TileMaps)" src="images/g/flappybird_godot/scene_world_tiles.png" title="Scene - WorldTiles (TileMaps)">
+<img alt="Scene - WorldTiles (TileMaps)" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_world_tiles.png" title="Scene - WorldTiles (TileMaps)">
<figcaption>Scene - WorldTiles (TileMaps)</figcaption>
</figure>
<p>I used the following directory structure:</p>
<figure id="__yafg-figure-13">
-<img alt="Scene - WorldTiles - Directory structure" src="images/g/flappybird_godot/scene_world_tiles_directory_structure.png" title="Scene - WorldTiles - Directory structure">
+<img alt="Scene - WorldTiles - Directory structure" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_world_tiles_directory_structure.png" title="Scene - WorldTiles - Directory structure">
<figcaption>Scene - WorldTiles - Directory structure</figcaption>
</figure>
-<p>To configure the GroundTileMap, select the node and click on &ldquo;(empty)&rdquo; on the <em>TileMap/Tile set</em> property and then click on &ldquo;New TileSet&rdquo;, then click where the &ldquo;(empty)&rdquo; used to be, a new window should open on the bottom:</p>
+<p>To configure the <code>GroundTileMap</code>, select the node and click on <code>(empty)</code> on the <em>TileMap/Tile set</em> property and then click on <code>New TileSet</code>, then click where the <code>(empty)</code> used to be, a new window should open on the bottom:</p>
<figure id="__yafg-figure-14">
-<img alt="TileSet - Configuration window" src="images/g/flappybird_godot/tile_set_config_window.png" title="TileSet - Configuration window">
+<img alt="TileSet - Configuration window" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_config_window.png" title="TileSet - Configuration window">
<figcaption>TileSet - Configuration window</figcaption>
</figure>
-<p>Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow &ldquo;+ New Single Tile&rdquo;, activate the grid and select any of the tiles. Should look like this:</p>
+<p>Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow <code>+ New Single Tile</code>, activate the grid and select any of the tiles. Should look like this:</p>
<figure id="__yafg-figure-15">
-<img alt="TileSet - New single tile" src="images/g/flappybird_godot/tile_set_new_single_tile.png" title="TileSet - New single tile">
+<img alt="TileSet - New single tile" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_new_single_tile.png" title="TileSet - New single tile">
<figcaption>TileSet - New single tile</figcaption>
</figure>
-<p>We need to do this because for some reason we can&rsquo;t change the snap options before selecting a tile. After selecting a random tile, set up the <em>Snap Options/Step</em> (in the <em>Inspector</em>) and set it to 16x16 (or if using a different tile set, to it&rsquo;s tile size):</p>
+<p>We need to do this because for some reason we can&rsquo;t change the snap options before selecting a tile. After selecting a random tile, set up the <em>Snap Options/Step</em> (in the <em>Inspector</em>) and set it to <code>16x16</code> (or if using a different tile set, to it&rsquo;s tile size):</p>
<figure id="__yafg-figure-16">
-<img alt="TileSet - Tile - Step snap options" src="images/g/flappybird_godot/tile_set_tile_step_snap_options.png" title="TileSet - Tile - Step snap options">
+<img alt="TileSet - Tile - Step snap options" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_tile_step_snap_options.png" title="TileSet - Tile - Step snap options">
<figcaption>TileSet - Tile - Step snap options</figcaption>
</figure>
-<p>Now you can select the actual single tile. Once selected click on &ldquo;Collision&rdquo;, use the rectangle tool and draw the rectangle corresponding to that tile&rsquo;s collision:</p>
+<p>Now you can select the actual single tile. Once selected click on <code>Collision</code>, use the rectangle tool and draw the rectangle corresponding to that tile&rsquo;s collision:</p>
<figure id="__yafg-figure-17">
-<img alt="TileSet - Tile - Selection and collision" src="images/g/flappybird_godot/tile_set_tile_selection_collision.png" title="TileSet - Tile - Selection and collision">
+<img alt="TileSet - Tile - Selection and collision" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_tile_selection_collision.png" title="TileSet - Tile - Selection and collision">
<figcaption>TileSet - Tile - Selection and collision</figcaption>
</figure>
<p>Do the same for the other 3 tiles. If you select the <em>TileMap</em> itself again, it should look like this on the right (on default layout it&rsquo;s on the left of the <em>Inspector</em>):</p>
<figure id="__yafg-figure-18">
-<img alt="TileSet - Available tiles" src="images/g/flappybird_godot/tile_set_available_tiles.png" title="TileSet - Available tiles">
+<img alt="TileSet - Available tiles" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_available_tiles.png" title="TileSet - Available tiles">
<figcaption>TileSet - Available tiles</figcaption>
</figure>
<p>The ordering is important only for the &ldquo;underground tile&rdquo;, which is the filler ground, it should be at the end (index 3); if this is not the case, repeat the process (it&rsquo;s possible to rearrange them but it&rsquo;s hard to explain as it&rsquo;s pretty weird).</p>
-<p>At this point the tilemap doesn&rsquo;t have any physics and the cell size is wrong. Select the &ldquo;GroundTileMap&rdquo;, set the <em>TileMap/Cell/Size</em> to 16x16, the <em>TileMap/Collision/Layer</em> set to <code>bit 2</code> only (ground layer) and disable any <em>TileMap/Collision/Mask</em> bits. Should look something like this:</p>
+<p>At this point the tilemap doesn&rsquo;t have any physics and the cell size is wrong. Select the <code>GroundTileMap</code>, set the <em>TileMap/Cell/Size</em> to <code>16x16</code>, the <em>TileMap/Collision/Layer</em> set to <code>bit 2</code> only (ground layer) and disable any <em>TileMap/Collision/Mask</em> bits. Should look something like this:</p>
<figure id="__yafg-figure-19">
-<img alt="TileMap - Cell size and collision configuration" src="images/g/flappybird_godot/tile_map_cell_collision_configuration.png" title="TileMap - Cell size and collision configuration">
+<img alt="TileMap - Cell size and collision configuration" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_map_cell_collision_configuration.png" title="TileMap - Cell size and collision configuration">
<figcaption>TileMap - Cell size and collision configuration</figcaption>
</figure>
-<p>Now it&rsquo;s just a matter of repeating the same for the pipes (&ldquo;PipeTileMap&rdquo;), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the <em>Snap Options/Step</em> to 32x16, for example, just keep the cell size to 16x16.</p>
-<h5 id="default-ground-tiles">Default ground tiles<a class="headerlink" href="#default-ground-tiles" title="Permanent link">&para;</a></h5>
-<p>I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the &ldquo;WorldTiles&rdquo; scene, while selecting the &ldquo;GroundTileMap&rdquo;, you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from <code>(-8, 7)</code> to <code>(10, 7)</code> as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):</p>
+<p>Now it&rsquo;s just a matter of repeating the same for the pipes (<code>PipeTileMap</code>), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the <em>Snap Options/Step</em> to <code>32x16</code>, for example, just keep the cell size to <code>16x16</code>.</p>
+<h4 id="default-ground-tiles">Default ground tiles<a class="headerlink" href="#default-ground-tiles" title="Permanent link">&para;</a></h4>
+<p>I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the <code>WorldTiles</code> scene, while selecting the <code>GroundTileMap</code>, you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from <code>(-8, 7)</code> to <code>(10, 7)</code> as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):</p>
<figure id="__yafg-figure-20">
-<img alt="Scene - WorldTiles - Default ground tiles" src="images/g/flappybird_godot/world_tiles_default_tiles.png" title="Scene - WorldTiles - Default ground tiles">
+<img alt="Scene - WorldTiles - Default ground tiles" src="https://static.luevano.xyz/images/g/flappybird_godot/world_tiles_default_tiles.png" title="Scene - WorldTiles - Default ground tiles">
<figcaption>Scene - WorldTiles - Default ground tiles</figcaption>
</figure>
-<h4 id="player">Player<a class="headerlink" href="#player" title="Permanent link">&para;</a></h4>
-<p>On a new scene called &ldquo;Player&rdquo; with a <em>KinematicBody2D</em> node named &ldquo;Player&rdquo; as the root of the scene, then for the children: <em>AnimatedSprite</em> as &ldquo;Sprite&rdquo;, <em>CollisionShape2D</em> as &ldquo;Collision&rdquo; (with a circle shape) and 3 <em>AudioStreamPlayers</em> for &ldquo;JumpSound&rdquo;, &ldquo;DeadSound&rdquo; and &ldquo;HitSound&rdquo;. Not sure if it&rsquo;s a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the &ldquo;Player&rdquo; node and then it should look like this:</p>
+<h3 id="player">Player<a class="headerlink" href="#player" title="Permanent link">&para;</a></h3>
+<p>On a new scene called <code>Player</code> with a <em>KinematicBody2D</em> node named <code>Player</code> as the root of the scene, then for the children: <em>AnimatedSprite</em> as <code>Sprite</code>, <em>CollisionShape2D</em> as <code>Collision</code> (with a circle shape) and 3 <em>AudioStreamPlayers</em> for <code>JumpSound</code>, <code>DeadSound</code> and <code>HitSound</code>. Not sure if it&rsquo;s a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the <code>Player</code> node and then it should look like this:</p>
<figure id="__yafg-figure-21">
-<img alt="Scene - Player - Node setup" src="images/g/flappybird_godot/scene_player_node_setup.png" title="Scene - Player - Node setup">
+<img alt="Scene - Player - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_node_setup.png" title="Scene - Player - Node setup">
<figcaption>Scene - Player - Node setup</figcaption>
</figure>
-<p>Select the &ldquo;Player&rdquo; node and set the <em>CollisionShape2D/Collision/Layer</em> to 1 and the <em>CollisionObject2D/Collision/Mask</em> to 2 and 3 (ground and pipe).</p>
-<p>For the &ldquo;Sprite&rdquo; node, when selecting it click on the &ldquo;(empty)&rdquo; for the <em>AnimatedSprite/Frames</em> property and click &ldquo;New SpriteFrames&rdquo;, click again where the &ldquo;(empty)&rdquo; used to be and ane window should open on the bottom:</p>
+<p>Select the <code>Player</code> node and set the <em>CollisionShape2D/Collision/Layer</em> to <code>1</code> and the <em>CollisionObject2D/Collision/Mask</em> to <code>2</code> and <code>3</code> (ground and pipe).</p>
+<p>For the <code>Sprite</code> node, when selecting it click on the <code>(empty)</code> for the <em>AnimatedSprite/Frames</em> property and click <code>New SpriteFrames</code>, click again where the <code>(empty)</code> used to be and ane window should open on the bottom:</p>
<figure id="__yafg-figure-22">
-<img alt="Scene - Player - SpriteFrames window" src="images/g/flappybird_godot/scene_player_spriteframes_window.png" title="Scene - Player - SpriteFrames window">
+<img alt="Scene - Player - SpriteFrames window" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_spriteframes_window.png" title="Scene - Player - SpriteFrames window">
<figcaption>Scene - Player - SpriteFrames window</figcaption>
</figure>
-<p>Right off the bat, set the &ldquo;Speed&rdquo; to <code>10 FPS</code> (bottom left) and rename &ldquo;default&rdquo; to &ldquo;bird_1&rdquo;. With the &ldquo;bird_1&rdquo; selected, click on the &ldquo;Add frames from a Sprite Sheet&rdquo;, which is the second button under &ldquo;Animation Frames:&rdquo; which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the &ldquo;Select Frames&rdquo; window, change the &ldquo;Vertical&rdquo; to 1, and then select all 4 frames (<em>Ctrl + Scroll</em> wheel to zoom in):</p>
+<p>Right off the bat, set the <code>Speed</code> to <code>10 FPS</code> (bottom left) and rename <code>default</code> to <code>bird_1</code>. With the <code>bird_1</code> selected, click on the <code>Add frames from a Sprite Sheet</code>, which is the second button under <code>Animation Frames:</code> which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the <code>Select Frames</code> window, change the <code>Vertical</code> to <code>1</code>, and then select all 4 frames (<em>Ctrl + Scroll</em> wheel to zoom in):</p>
<figure id="__yafg-figure-23">
-<img alt="Scene - Player - Sprite sheet importer" src="images/g/flappybird_godot/scene_player_sprite_sheet_importer.png" title="Scene - Player - Sprite sheet importer">
+<img alt="Scene - Player - Sprite sheet importer" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png" title="Scene - Player - Sprite sheet importer">
<figcaption>Scene - Player - Sprite sheet importer</figcaption>
</figure>
<p>After that, the <em>SpriteFrames</em> window should look like this:</p>
<figure id="__yafg-figure-24">
-<img alt="Scene - Player - SpriteFrames window with sprite sheet configured" src="images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png" title="Scene - Player - SpriteFrames window with sprite sheet configured">
+<img alt="Scene - Player - SpriteFrames window with sprite sheet configured" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png" title="Scene - Player - SpriteFrames window with sprite sheet configured">
<figcaption>Scene - Player - SpriteFrames window with sprite sheet configured</figcaption>
</figure>
-<p>Finally, make sure the &ldquo;Sprite&rdquo; node has the <em>AnimatedSprite/Animation</em> is set to &ldquo;bird_1&rdquo; and that the &ldquo;Collision&rdquo; node is configured correctly for its size and position (I just have it as a radius of 7). As well as dropping the SFX files into the corresponding <em>AudioStreamPlayer</em> (into the <em>AudioStreamPlayer/Stream</em> property).</p>
-<h4 id="other">Other<a class="headerlink" href="#other" title="Permanent link">&para;</a></h4>
+<p>Finally, make sure the <code>Sprite</code> node has the <em>AnimatedSprite/Animation</em> is set to <code>bird_1</code> and that the <code>Collision</code> node is configured correctly for its size and position (I just have it as a radius of <code>7</code>). As well as dropping the SFX files into the corresponding <em>AudioStreamPlayer</em> (into the <em>AudioStreamPlayer/Stream</em> property).</p>
+<h3 id="other">Other<a class="headerlink" href="#other" title="Permanent link">&para;</a></h3>
<p>These are really simple scenes that don&rsquo;t require much setup:</p>
<ul>
-<li>&ldquo;CeilingDetector&rdquo;: just an <em>Area2D</em> node with a <em>CollisionShape2D</em> in the form of a rectangle (<em>CollisionShape2D/Shape/extents</em> to <code>(120, 10)</code>), stretched horizontally so it fits the whole screen. <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 4</code> (ceiling) and <em>CollisionObject2D/Collision/Mask</em> set to bit 1 (player).</li>
-<li>&ldquo;ScoreDetector&rdquo;: similar to the &ldquo;CeilingDetector&rdquo;, but vertical (<em>CollisionShape2D/Shape/extents</em> to <code>(2.5, 128)</code>) and <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 1</code> (player).</li>
-<li>&ldquo;WorldDetector&rdquo;: <em>Node2D</em> with a script attached, and 3 <em>RayCast2D</em> as children:<ul>
-<li>&ldquo;NewTile&rdquo;: <em>Raycast2D/Enabled</em> to true (checked), <em>Raycast2D/Cast To</em> <code>(0, 400)</code>, <em>Raycast2D/Collision Mask</em> to <code>bit 2</code> (ground) and <em>Node2D/Transform/Position</em> to <code>(152, -200)</code></li>
-<li>&ldquo;OldTile&rdquo;: same as &ldquo;NewTile&rdquo;, except for the <em>Node2D/Transform/Position</em>, set it to <code>(-152, -200)</code>.</li>
-<li>&ldquo;OldPipe&rdquo;: same as &ldquo;OldTile&rdquo;, except for the <em>Raycast2D/Collision Mask</em>, set it to <code>bit 3</code> (pipe).</li>
+<li><code>CeilingDetector</code>: just an <em>Area2D</em> node with a <em>CollisionShape2D</em> in the form of a rectangle (<em>CollisionShape2D/Shape/extents</em> to <code>(120, 10)</code>), stretched horizontally so it fits the whole screen. <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 4</code> (ceiling) and <em>CollisionObject2D/Collision/Mask</em> set to <code>bit 1</code> (player).</li>
+<li><code>ScoreDetector</code>: similar to the <code>CeilingDetector</code>, but vertical (<em>CollisionShape2D/Shape/extents</em> to <code>(2.5, 128)</code>) and <em>CollisionObject2D/Collision/Layer</em> set to <code>bit 1</code> (player).</li>
+<li><code>WorldDetector</code>: <em>Node2D</em> with a script attached, and 3 <em>RayCast2D</em> as children:<ul>
+<li><code>NewTile</code>: <em>Raycast2D/Enabled</em> to true (checked), <em>Raycast2D/Cast To</em> <code>(0, 400)</code>, <em>Raycast2D/Collision Mask</em> to <code>bit 2</code> (ground) and <em>Node2D/Transform/Position</em> to <code>(152, -200)</code></li>
+<li><code>OldTile</code>: same as &ldquo;NewTile&rdquo;, except for the <em>Node2D/Transform/Position</em>, set it to <code>(-152, -200)</code>.</li>
+<li><code>OldPipe</code>: same as &ldquo;OldTile&rdquo;, except for the <em>Raycast2D/Collision Mask</em>, set it to <code>bit 3</code> (pipe).</li>
</ul>
</li>
</ul>
-<h4 id="game">Game<a class="headerlink" href="#game" title="Permanent link">&para;</a></h4>
-<p>This is the actual &ldquo;Game&rdquo; scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a <em>Node2D</em> and also has an attached script. Also need to add 2 additional <em>AudioStreamPlayers</em> for the &ldquo;start&rdquo; and &ldquo;score&rdquo; sounds, as well as a <em>Sprite</em> for the background (<em>Sprite/Offset/Offset</em> set to <code>(0, 10)</code>) and a <em>Camera2D</em> (<em>Camera2D/Current</em> set to true (checked)). It should look something like this:</p>
+<h3 id="game">Game<a class="headerlink" href="#game" title="Permanent link">&para;</a></h3>
+<p>This is the actual <code>Game</code> scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a <em>Node2D</em> and also has an attached script. Also need to add 2 additional <em>AudioStreamPlayers</em> for the &ldquo;start&rdquo; and &ldquo;score&rdquo; sounds, as well as a <em>Sprite</em> for the background (<em>Sprite/Offset/Offset</em> set to <code>(0, 10)</code>) and a <em>Camera2D</em> (<em>Camera2D/Current</em> set to true (checked)). It should look something like this:</p>
<figure id="__yafg-figure-25">
-<img alt="Scene - Game - Node setup" src="images/g/flappybird_godot/scene_game_node_setup.png" title="Scene - Game - Node setup">
+<img alt="Scene - Game - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_game_node_setup.png" title="Scene - Game - Node setup">
<figcaption>Scene - Game - Node setup</figcaption>
</figure>
<p>The scene viewport should look something like the following:</p>
<figure id="__yafg-figure-26">
-<img alt="Scene - Game - Viewport" src="images/g/flappybird_godot/scene_game_viewport.png" title="Scene - Game - Viewport">
+<img alt="Scene - Game - Viewport" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_game_viewport.png" title="Scene - Game - Viewport">
<figcaption>Scene - Game - Viewport</figcaption>
</figure>
-<h4 id="ui">UI<a class="headerlink" href="#ui" title="Permanent link">&para;</a></h4>
-<h5 id="fonts">Fonts<a class="headerlink" href="#fonts" title="Permanent link">&para;</a></h5>
-<p>We need some font &ldquo;Resources&rdquo; to style the <em>Label</em> fonts. Under the <em>FileSystem</em> window, right click on the fonts directory (create one if needed) and click on &ldquo;New Resource&hellip;&rdquo; and select <em>DynamicFontData</em>, save it in the &ldquo;fonts&rdquo; directory as &ldquo;SilverDynamicFontData.tres&rdquo; (&ldquo;Silver&rdquo; as it is the font I&rsquo;m using) then double click the just created resource and set the <em>DynamicFontData/Font Path</em> to the actual &ldquo;Silver.ttf&rdquo; font (or whatever you want).</p>
-<p>Then create a new resource and this time select <em>DynamicFont</em>, name it &ldquo;SilverDynamicFont.tres&rdquo;, then double click to edit and add the &ldquo;SilverDynamicFontData.tres&rdquo; to the <em>DynamicFont/Font/Font Data</em> property (and I personally toggled off the <em>DynamicFont/Font/Antialiased</em> property), now just set the <em>DynamicFont/Settings/(Size, Outline Size, Outline Color)</em> to 32, 1 and black, respectively (or any other values you want). It should look something like this:</p>
+<h3 id="ui">UI<a class="headerlink" href="#ui" title="Permanent link">&para;</a></h3>
+<h4 id="fonts">Fonts<a class="headerlink" href="#fonts" title="Permanent link">&para;</a></h4>
+<p>We need some font <code>Resources</code> to style the <em>Label</em> fonts. Under the <em>FileSystem</em> window, right click on the fonts directory (create one if needed) and click on <code>New Resource...</code> and select <em>DynamicFontData</em>, save it in the &ldquo;fonts&rdquo; directory as <code>SilverDynamicFontData.tres</code> (<code>Silver</code> as it is the font I&rsquo;m using) then double click the just created resource and set the <em>DynamicFontData/Font Path</em> to the actual <code>Silver.ttf</code> font (or whatever you want).</p>
+<p>Then create a new resource and this time select <em>DynamicFont</em>, name it <code>SilverDynamicFont.tres</code>, then double click to edit and add the <code>SilverDynamicFontData.tres</code> to the <em>DynamicFont/Font/Font Data</em> property (and I personally toggled off the <em>DynamicFont/Font/Antialiased</em> property), now just set the <em>DynamicFont/Settings/(Size, Outline Size, Outline Color)</em> to <code>32</code>, <code>1</code> and <code>black</code>, respectively (or any other values you want). It should look something like this:</p>
<figure id="__yafg-figure-27">
-<img alt="Resource - DynamicFont - Default font" src="images/g/flappybird_godot/resource_dynamic_font.png" title="Resource - DynamicFont - Default font">
+<img alt="Resource - DynamicFont - Default font" src="https://static.luevano.xyz/images/g/flappybird_godot/resource_dynamic_font.png" title="Resource - DynamicFont - Default font">
<figcaption>Resource - DynamicFont - Default font</figcaption>
</figure>
-<p>Do the same for another <em>DynamicFont</em> which will be used for the score label, named &ldquo;SilverScoreDynamicFont.tres&rdquo;. Only changes are <em>Dynamic/Settings/(Size, Outline Size)</em> which are set to 128 and 2, respectively. The final files for the fonts should look something like this:</p>
+<p>Do the same for another <em>DynamicFont</em> which will be used for the score label, named <code>SilverScoreDynamicFont.tres</code>. Only changes are <em>Dynamic/Settings/(Size, Outline Size)</em> which are set to <code>128</code> and <code>2</code>, respectively. The final files for the fonts should look something like this:</p>
<figure id="__yafg-figure-28">
-<img alt="Resource - Dynamicfont - Directory structure" src="images/g/flappybird_godot/resource_dynamic_font_directory_structure.png" title="Resource - Dynamicfont - Directory structure">
+<img alt="Resource - Dynamicfont - Directory structure" src="https://static.luevano.xyz/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png" title="Resource - Dynamicfont - Directory structure">
<figcaption>Resource - Dynamicfont - Directory structure</figcaption>
</figure>
-<h5 id="scene-setup">Scene setup<a class="headerlink" href="#scene-setup" title="Permanent link">&para;</a></h5>
-<p>This has a bunch of nested nodes, so I&rsquo;ll try to be concise here. The root node is a <em>CanvasLayer</em> named &ldquo;UI&rdquo; with its own script attached, and for the children:</p>
+<h4 id="scene-setup">Scene setup<a class="headerlink" href="#scene-setup" title="Permanent link">&para;</a></h4>
+<p>This has a bunch of nested nodes, so I&rsquo;ll try to be concise here. The root node is a <em>CanvasLayer</em> named <code>UI</code> with its own script attached, and for the children:</p>
<ul>
-<li>&ldquo;MarginContainer&rdquo;: <em>MarginContainer</em> with <em>Control/Margin/(Left, Top)</em> set to <code>10</code> and <em>Control/Margin/(Right, Bottom)</em> set to <code>-10</code>.<ul>
-<li>&ldquo;InfoContainer&rdquo;: <em>VBoxContainer</em> with <em>Control/Theme Overrides/Constants/Separation</em> set to <code>250</code>.<ul>
-<li>&ldquo;ScoreContainer&rdquo;: <em>VBoxContainer</em>.<ul>
-<li>&ldquo;Score&rdquo;: <em>Label</em> with <em>Label/Align</em> set to &ldquo;Center&rdquo;, <em>Control/Theme Overrides/Fonts/Font</em> to the &ldquo;SilverScoreDynamicFont.tres&rdquo;, if needed adjust the <em>DynamicFont</em> settings.</li>
-<li>&ldquo;HighScore: same as &ldquo;Score&rdquo;, escept for the <em>Control/Theme Overrides/Fonts/Font</em> which is set to &ldquo;SilverDynamicFont.tres&rdquo;.</li>
+<li><code>MarginContainer</code>: <em>MarginContainer</em> with <em>Control/Margin/(Left, Top)</em> set to <code>10</code> and <em>Control/Margin/(Right, Bottom)</em> set to <code>-10</code>.<ul>
+<li><code>InfoContainer</code>: <em>VBoxContainer</em> with <em>Control/Theme Overrides/Constants/Separation</em> set to <code>250</code>.<ul>
+<li><code>ScoreContainer</code>: <em>VBoxContainer</em>.<ul>
+<li><code>Score</code>: <em>Label</em> with <em>Label/Align</em> set to <code>Center</code>, <em>Control/Theme Overrides/Fonts/Font</em> to the <code>SilverScoreDynamicFont.tres</code>, if needed adjust the <em>DynamicFont</em> settings.</li>
+<li><code>HighScore</code>: same as <code>Score</code>, escept for the <em>Control/Theme Overrides/Fonts/Font</em> which is set to <code>SilverDynamicFont.tres</code>.</li>
</ul>
</li>
-<li>&ldquo;StartGame&rdquo;: Same as &ldquo;HighScore&rdquo;.</li>
+<li><code>StartGame</code>: Same as <code>HighScore</code>.</li>
</ul>
</li>
-<li>&ldquo;DebugContainer&rdquo;: <em>VBoxContainer</em>.<ul>
-<li>&ldquo;FPS&rdquo;: <em>Label</em>.</li>
+<li><code>DebugContainer</code>: <em>VBoxContainer</em>.<ul>
+<li><code>FPS</code>: <em>Label</em>.</li>
</ul>
</li>
-<li>&ldquo;VersionContainer&rdquo;: <em>VBoxContainer</em> with <em>BoxContainer/Alignment</em> set to &ldquo;Begin&rdquo;.<ul>
-<li>&ldquo;Version&rdquo;: <em>Label</em> with <em>Label/Align</em> set to &ldquo;Right&rdquo;.</li>
+<li><code>VersionContainer</code>: <em>VBoxContainer</em> with <em>BoxContainer/Alignment</em> set to <code>Begin</code>.<ul>
+<li><code>Version</code>: <em>Label</em> with <em>Label/Align</em> set to <code>Right</code>.</li>
</ul>
</li>
</ul>
@@ -850,17 +939,17 @@ func physics_process(delta: float) -&gt; void:
</ul>
<p>The scene ends up looking like this:</p>
<figure id="__yafg-figure-29">
-<img alt="Scene - UI - Node setup" src="images/g/flappybird_godot/scene_ui.png" title="Scene - UI - Node setup">
+<img alt="Scene - UI - Node setup" src="https://static.luevano.xyz/images/g/flappybird_godot/scene_ui.png" title="Scene - UI - Node setup">
<figcaption>Scene - UI - Node setup</figcaption>
</figure>
-<h4 id="main">Main<a class="headerlink" href="#main" title="Permanent link">&para;</a></h4>
-<p>This is the final scene where we connect the Game and the UI. It&rsquo;s made of a <em>Node2D</em> with it&rsquo;s own script attached and an instance of &ldquo;Game&rdquo; and &ldquo;UI&rdquo; as it&rsquo;s children.</p>
-<p>This is a good time to set the default scene when we run the game by going to <em>Project -&gt; Project settings&hellip; -&gt; General</em> and in <em>Application/Run</em> set the <em>Main Scene</em> to the &ldquo;Main.tscn&rdquo; scene.</p>
-<h3 id="scripting">Scripting<a class="headerlink" href="#scripting" title="Permanent link">&para;</a></h3>
+<h3 id="main">Main<a class="headerlink" href="#main" title="Permanent link">&para;</a></h3>
+<p>This is the final scene where we connect the <code>Game</code> and the <code>UI</code>. It&rsquo;s made of a <em>Node2D</em> with it&rsquo;s own script attached and an instance of <code>Game</code> and <code>UI</code> as it&rsquo;s children.</p>
+<p>This is a good time to set the default scene when we run the game by going to <em>Project -&gt; Project settings&hellip; -&gt; General</em> and in <em>Application/Run</em> set the <em>Main Scene</em> to the <code>Main.tscn</code> scene.</p>
+<h2 id="scripting">Scripting<a class="headerlink" href="#scripting" title="Permanent link">&para;</a></h2>
<p>I&rsquo;m going to keep this scripting part to the most basic code blocks, as it&rsquo;s too much code, for a complete view you can head to the <a href="https://github.com/luevano/flappybird_godot">source code</a>.</p>
<p>As of now, the game itself doesn&rsquo;t do anything if we hit play. The first thing to do so we have something going on is to do the minimal player scripting.</p>
-<h4 id="player_1">Player<a class="headerlink" href="#player_1" title="Permanent link">&para;</a></h4>
-<p>The most basic code needed so the bird goes up and down is to just detect &ldquo;jump&rdquo; key presses and add a negative jump velocity so it goes up (<code>y</code> coordinate is reversed in godot&hellip;), we also check the velocity sign of the <code>y</code> coordinate to decide if the animation is playing or not.</p>
+<h3 id="player_1">Player<a class="headerlink" href="#player_1" title="Permanent link">&para;</a></h3>
+<p>The most basic code needed so the bird goes up and down is to just detect <code>jump</code> key presses and add a negative jump velocity so it goes up (<code>y</code> coordinate is reversed in godot&hellip;), we also check the velocity sign of the <code>y</code> coordinate to decide if the animation is playing or not.</p>
<pre><code class="language-gdscript">class_name Player
extends KinematicBody2D
@@ -909,7 +998,7 @@ func _physics_process(delta: float) -&gt; void:
dead_sound.play()
</code></pre>
<p>Finally need to add the actual checks for when the player dies (like collision with ground or pipe) as well as a function that listens to a signal for when the player goes to the ceiling.</p>
-<h4 id="worlddetector">WorldDetector<a class="headerlink" href="#worlddetector" title="Permanent link">&para;</a></h4>
+<h3 id="worlddetector">WorldDetector<a class="headerlink" href="#worlddetector" title="Permanent link">&para;</a></h3>
<p>The code is pretty simple, we just need a way of detecting if we ran out of ground and send a signal, as well as sending as signal when we start detecting ground/pipes behind us (to remove it) because the world is being generated as we move. The most basic functions needed are:</p>
<pre><code class="language-gdscript">func _was_colliding(detector: RayCast2D, flag: bool, signal_name: String) -&gt; bool:
if detector.is_colliding():
@@ -928,8 +1017,8 @@ func _now_colliding(detector: RayCast2D, flag: bool, signal_name: String) -&gt;
return false
</code></pre>
<p>We need to keep track of 3 &ldquo;flags&rdquo;: <code>ground_was_colliding</code>, <code>ground_now_colliding</code> and <code>pipe_now_colliding</code> (and their respective signals), which are going to be used to do the checks inside <code>_physics_process</code>. For example for checking for new ground: <code>ground_now_colliding = _now_colliding(old_ground, ground_now_colliding, "ground_started_colliding")</code>.</p>
-<h4 id="worldtiles">WorldTiles<a class="headerlink" href="#worldtiles" title="Permanent link">&para;</a></h4>
-<p>This script is what handles the &ldquo;GroundTileMap&rdquo; as well as the &ldquo;PipeTileMap&rdquo; and just basically functions as a &ldquo;Signal bus&rdquo; connecting a bunch of signals from the &ldquo;WorldDetector&rdquo; with the <em>TileMaps</em> and just tracking how many pipes have been placed:</p>
+<h3 id="worldtiles">WorldTiles<a class="headerlink" href="#worldtiles" title="Permanent link">&para;</a></h3>
+<p>This script is what handles the <code>GroundTileMap</code> as well as the <code>PipeTileMap</code> and just basically functions as a &ldquo;Signal bus&rdquo; connecting a bunch of signals from the <code>WorldDetector</code> with the <em>TileMaps</em> and just tracking how many pipes have been placed:</p>
<pre><code class="language-gdscript">export(int, 2, 20, 2) var PIPE_SEP: int = 6
var tiles_since_last_pipe: int = PIPE_SEP - 1
@@ -950,7 +1039,7 @@ func _on_WorldDetector_ground_started_colliding() -&gt; void:
func _on_WorldDetector_pipe_started_colliding() -&gt; void:
emit_signal(&quot;remove_pipe&quot;)
</code></pre>
-<h5 id="groundtilemap">GroundTileMap<a class="headerlink" href="#groundtilemap" title="Permanent link">&para;</a></h5>
+<h4 id="groundtilemap">GroundTileMap<a class="headerlink" href="#groundtilemap" title="Permanent link">&para;</a></h4>
<p>This is the node that actually places the ground tiles upong receiving a signal. In general, what you want is to keep track of the newest tile that you need to place (empty spot) as well as the last tile that is in the tilemap (technically the first one if you count from left to right). I was experimenting with <code>enum</code>s so I used them to define the possible <code>Ground</code> tiles:</p>
<pre><code class="language-gdscript">enum Ground {
TILE_1,
@@ -981,10 +1070,10 @@ func _remove_first_ground() -&gt; void:
old_tile_position += Vector2.RIGHT
</code></pre>
<p>Where you might notice that the <code>_initial_new_tile_x</code> is <code>11</code>, instead of <code>10</code>, refer to <a href="#default-ground-tiles">Default ground tiles</a> where we placed tiles from <code>-8</code> to <code>10</code>, so the next empty one is <code>11</code>. These <code>_place_new_ground</code> and <code>_remove_first_ground</code> functions are called upon receiving the signal.</p>
-<h5 id="pipetilemap">PipeTileMap<a class="headerlink" href="#pipetilemap" title="Permanent link">&para;</a></h5>
-<p>This is really similar to the &ldquo;GroundTileMap&rdquo; code, instead of defining an <code>enum</code> for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):</p>
+<h4 id="pipetilemap">PipeTileMap<a class="headerlink" href="#pipetilemap" title="Permanent link">&para;</a></h4>
+<p>This is really similar to the <code>GroundTileMap</code> code, instead of defining an <code>enum</code> for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):</p>
<figure id="__yafg-figure-30">
-<img alt="PipeTileMap - Tile set indexes" src="images/g/flappybird_godot/tile_set_pipes_indexes.png" title="PipeTileMap - Tile set indexes">
+<img alt="PipeTileMap - Tile set indexes" src="https://static.luevano.xyz/images/g/flappybird_godot/tile_set_pipes_indexes.png" title="PipeTileMap - Tile set indexes">
<figcaption>PipeTileMap - Tile set indexes</figcaption>
</figure>
<p>Then you can use the following &ldquo;pipe patterns&rdquo;:</p>
@@ -997,7 +1086,7 @@ func _remove_first_ground() -&gt; void:
PipePattern.PIPE_6: [0, 1, 2, 3, 4, -1, -1, -1, 0, 1, 2, 2, 2, 2, 2, 2]
}
</code></pre>
-<p>Now, the pipe system requires a bit more of tracking as we need to instantiate a &ldquo;ScoreDetector&rdquo; here, too. I ended up keeping track of the placed pipes/detectors by using a &ldquo;pipe stack&rdquo; (and &ldquo;detector stack&rdquo;) which is just an array of placed objects from which I pop the first when deleting them:</p>
+<p>Now, the pipe system requires a bit more of tracking as we need to instantiate a <code>ScoreDetector</code> here, too. I ended up keeping track of the placed pipes/detectors by using a &ldquo;pipe stack&rdquo; (and &ldquo;detector stack&rdquo;) which is just an array of placed objects from which I pop the first when deleting them:</p>
<pre><code class="language-gdscript">onready var _pipe_sep: int = get_parent().PIPE_SEP
const _pipe_size: int = 16
const _ground_level: int = 7
@@ -1013,7 +1102,7 @@ var detector_scene: PackedScene = preload(&quot;res://levels/detectors/score_det
var detector_offset: Vector2 = Vector2(16.0, -(_pipe_size / 2.0) * 16.0)
var detector_stack: Array
</code></pre>
-<p>The <code>detector_offset</code> is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new &ldquo;ScoreDetector&rdquo; (<code>detector_scene</code>) and set it&rsquo;s position to the pipe starting position plus the offset, so it&rsquo;s centered in the pipe, then just need to connect the &ldquo;body_entered&rdquo; signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:</p>
+<p>The <code>detector_offset</code> is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new <code>ScoreDetector</code> (<code>detector_scene</code>) and set it&rsquo;s position to the pipe starting position plus the offset, so it&rsquo;s centered in the pipe, then just need to connect the <code>body_entered</code> signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:</p>
<pre><code class="language-gdscript">func _place_new_pipe() -&gt; void:
var current_pipe: Vector2 = new_pipe_starting_position
for tile in pipe[_get_random_pipe()]:
@@ -1043,8 +1132,8 @@ var detector_stack: Array
detector.queue_free()
</code></pre>
<p>These functions are called when receiving the signal to place/remove pipes.</p>
-<h4 id="saved-data">Saved data<a class="headerlink" href="#saved-data" title="Permanent link">&para;</a></h4>
-<p>Before proceeding, we require a way to save/load data (for the high scores). We&rsquo;re going to use the <em>ConfigFile</em> node that uses a custom version of the &ldquo;ini&rdquo; file format. Need to define where to save the data:</p>
+<h3 id="saved-data">Saved data<a class="headerlink" href="#saved-data" title="Permanent link">&para;</a></h3>
+<p>Before proceeding, we require a way to save/load data (for the high scores). We&rsquo;re going to use the <em>ConfigFile</em> node that uses a custom version of the <code>ini</code> file format. Need to define where to save the data:</p>
<pre><code class="language-gdscript">const DATA_PATH: String = &quot;user://data.cfg&quot;
const SCORE_SECTION: String = &quot;score&quot;
var _data: ConfigFile
@@ -1084,12 +1173,12 @@ func get_high_score() -&gt; int:
set_new_high_score(0)
save_data()
</code></pre>
-<p>Now, this script in particular will need to be a <a href="https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html">Singleton (AutoLoad)</a>, which means that there will be only one instance and will be available across all scripts. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; AutoLoad</em> and select this script in the &ldquo;Path:&rdquo; and add a &ldquo;Node Name:&rdquo; (I used &ldquo;SavedData&rdquo;, if you use something else, be careful while following this devlog) which will be the name we&rsquo;ll use to access the singleton. Toggle on &ldquo;Enable&rdquo; if needed, it should look like this:</p>
+<p>Now, this script in particular will need to be a <a href="https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html">Singleton (AutoLoad)</a>, which means that there will be only one instance and will be available across all scripts. To do so, go to <em>Project -&gt; Project settings&hellip; -&gt; AutoLoad</em> and select this script in the <code>Path:</code> and add a <code>Node Name:</code> (I used <code>SavedData</code>, if you use something else, be careful while following this devlog) which will be the name we&rsquo;ll use to access the singleton. Toggle on <code>Enable</code> if needed, it should look like this:</p>
<figure id="__yafg-figure-31">
-<img alt="Project settings - AutoLoad - SavedData singleton" src="images/g/flappybird_godot/project_settings_autoload_saved_data.png" title="Project settings - AutoLoad - SavedData singleton">
+<img alt="Project settings - AutoLoad - SavedData singleton" src="https://static.luevano.xyz/images/g/flappybird_godot/project_settings_autoload_saved_data.png" title="Project settings - AutoLoad - SavedData singleton">
<figcaption>Project settings - AutoLoad - SavedData singleton</figcaption>
</figure>
-<h4 id="game_1">Game<a class="headerlink" href="#game_1" title="Permanent link">&para;</a></h4>
+<h3 id="game_1">Game<a class="headerlink" href="#game_1" title="Permanent link">&para;</a></h3>
<p>The game script it&rsquo;s also like a &ldquo;Signal bus&rdquo; in the sense that it connects all its childs&rsquo; signals together, and also has the job of starting/stopping the <code>_process</code> and <code>_physics_process</code> methods from the childs as needed. First, we need to define the signals and and references to all child nodes:</p>
<pre><code class="language-gdscript">signal game_started
signal game_over
@@ -1104,7 +1193,7 @@ onready var camera: Camera2D = $Camera
onready var start_sound: AudioStreamPlayer = $StartSound
onready var score_sound: AudioStreamPlayer = $ScoreSound
</code></pre>
-<p>It&rsquo;s important to get the actual &ldquo;player speed&rdquo;, as we&rsquo;re using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the &ldquo;game_scale&rdquo; we setup at the beginning and compute the <code>player_speed</code>:</p>
+<p>It&rsquo;s important to get the actual &ldquo;player speed&rdquo;, as we&rsquo;re using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the <code>game_scale</code> we setup at the beginning and compute the <code>player_speed</code>:</p>
<pre><code class="language-gdscript">var _game_scale: float = ProjectSettings.get_setting(&quot;application/config/game_scale&quot;)
var player_speed: float
@@ -1114,7 +1203,7 @@ func _ready() -&gt; void:
# so we move at the actual speed of the player
player_speed = player.SPEED / _game_scale
</code></pre>
-<p>This <code>player_speed</code> will be needed as we need to move all the nodes (&ldquo;Background&rdquo;, &ldquo;Camera&rdquo;, etc.) in the <code>x</code> axis as the player is moving. This is done in the <code>_physics_process</code>:</p>
+<p>This <code>player_speed</code> will be needed as we need to move all the nodes (<code>Background</code>, <code>Camera</code>, etc.) in the <code>x</code> axis as the player is moving. This is done in the <code>_physics_process</code>:</p>
<pre><code class="language-gdscript">func _physics_process(delta: float) -&gt; void:
ceiling_detector.move_local_x(player_speed * delta)
world_detector.move_local_x(player_speed * delta)
@@ -1159,8 +1248,8 @@ func _on_ScoreDetector_body_entered(body: Node2D) -&gt; void:
emit_signal(&quot;new_score&quot;, score, high_score)
score_sound.play()
</code></pre>
-<p>When the <code>player</code> dies, we set all processing to <code>false</code>, except for the player itself (so it can drop all the way to the ground). Also, when receiving a &ldquo;scoring&rdquo; signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the <code>high_score</code> at the beginning by calling <code>SavedData.get_high_score()</code>. This signal we emit will be received by the UI so it updates accordingly.</p>
-<h4 id="ui_1">UI<a class="headerlink" href="#ui_1" title="Permanent link">&para;</a></h4>
+<p>When the <code>player</code> dies, we set all processing to <code>false</code>, except for the player itself (so it can drop all the way to the ground). Also, when receiving a &ldquo;scoring&rdquo; signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the <code>high_score</code> at the beginning by calling <code>SavedData.get_high_score()</code>. This signal we emit will be received by the <code>UI</code> so it updates accordingly.</p>
+<h3 id="ui_1">UI<a class="headerlink" href="#ui_1" title="Permanent link">&para;</a></h3>
<p>First thing is to get a reference to all the child <em>Labels</em>, an initial reference to the high score as well as the version defined in the project settings:</p>
<pre><code class="language-gdscript">onready var fps_label: Label = $MarginContainer/DebugContainer/FPS
onready var version_label: Label = $MarginContainer/VersionContainer/Version
@@ -1204,8 +1293,8 @@ func _on_Game_new_score(score: int, high_score: int) -&gt; void:
score_label.set_text(String(score))
high_score_label.set_text(&quot;High score: %s&quot; % high_score)
</code></pre>
-<h4 id="main_1">Main<a class="headerlink" href="#main_1" title="Permanent link">&para;</a></h4>
-<p>This is the shortest script, it just connects the signals between the &ldquo;Game&rdquo; and the &ldquo;UI&rdquo;:</p>
+<h3 id="main_1">Main<a class="headerlink" href="#main_1" title="Permanent link">&para;</a></h3>
+<p>This is the shortest script, it just connects the signals between the <code>Game</code> and the <code>UI</code>:</p>
<pre><code class="language-gdscript">onready var game: Game = $Game
onready var ui: UI = $UI
@@ -1217,15 +1306,15 @@ func _ready() -&gt; void:
game.connect(&quot;game_over&quot;, ui, &quot;_on_Game_game_over&quot;)
game.connect(&quot;new_score&quot;, ui, &quot;_on_Game_new_score&quot;)
</code></pre>
-<h3 id="final-notes-and-exporting">Final notes and exporting<a class="headerlink" href="#final-notes-and-exporting" title="Permanent link">&para;</a></h3>
+<h2 id="final-notes-and-exporting">Final notes and exporting<a class="headerlink" href="#final-notes-and-exporting" title="Permanent link">&para;</a></h2>
<p>At this point the game should be fully playable (if any detail missing feel free to look into the source code linked at the beginning). Only thing missing is an icon for the game; I did one pretty quicly with the assets I had.</p>
-<h4 id="preparing-the-files">Preparing the files<a class="headerlink" href="#preparing-the-files" title="Permanent link">&para;</a></h4>
+<h3 id="preparing-the-files">Preparing the files<a class="headerlink" href="#preparing-the-files" title="Permanent link">&para;</a></h3>
<p>If you followed the directory structure I used, then only thing needed is to transform the icon to a native Windows <code>ico</code> format (if exporting to Windows, else ignore this part). For this you need <a href="https://imagemagick.org/index.php">ImageMagick</a> or some other program that can transform <code>png</code> (or whatever file format you used for the icon) to <code>ico</code>. I used [Chocolatey][https://chocolatey.org/] to install <code>imagemagick</code>, then to convert the icon itself used: <code>magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico</code> as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/changing_application_icon_for_windows.html">Changing application icon for Windows</a>.</p>
-<h4 id="exporting">Exporting<a class="headerlink" href="#exporting" title="Permanent link">&para;</a></h4>
-<p>You need to download the templates for exporting as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html">Exporting projects</a>. Basically you go to <em>Editor -&gt; Manage Export Templates&hellip;</em> and download the latest one specific to your <em>Godot</em> version by clicking on &ldquo;Download and Install&rdquo;.</p>
+<h3 id="exporting">Exporting<a class="headerlink" href="#exporting" title="Permanent link">&para;</a></h3>
+<p>You need to download the templates for exporting as detailed in <em>Godot</em>&lsquo;s <a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html">Exporting projects</a>. Basically you go to <em>Editor -&gt; Manage Export Templates&hellip;</em> and download the latest one specific to your <em>Godot</em> version by clicking on <code>Download and Install</code>.</p>
<p>If exporting for Windows then you also need to download <code>rcedit</code> from <a href="https://github.com/electron/rcedit/releases/latest">here</a>. Just place it wherever you want (I put it next to the <em>Godot</em> executable).</p>
-<p>Then go to <em>Project -&gt; Export&hellip;</em> and the Window should be empty, add a new template by clicking on &ldquo;Add&hellip;&rdquo; at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the &ldquo;Export Path&rdquo; for each template, which is te location of where the executable will be written to, and in the case of the Windows Desktop template you could also setup stuff like &ldquo;Company Name&rdquo;, &ldquo;Product Name&rdquo;, &ldquo;File/Product Version&rdquo;, etc..</p>
-<p>Once the templates are setup, select any and click on &ldquo;Export Project&rdquo; at the bottom, and make sure to untoggle &ldquo;Export With Debug&rdquo; in the window that pops up, this checkbox should be at the bottom of the new window.</p>]]></content:encoded>
+<p>Then go to <em>Project -&gt; Export&hellip;</em> and the Window should be empty, add a new template by clicking on <code>Add...</code> at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the &ldquo;Export Path&rdquo; for each template, which is te location of where the executable will be written to, and in the case of the <em>Windows Desktop</em> template you could also setup stuff like <code>Company Name</code>, <code>Product Name</code>, <code>File/Product Version</code>, etc..</p>
+<p>Once the templates are setup, select any and click on <code>Export Project</code> at the bottom, and make sure to untoggle <code>Export With Debug</code> in the window that pops up, this checkbox should be at the bottom of the new window.</p>]]></content:encoded>
</item>
<item>
<title>General Godot project structure</title>
@@ -1234,6 +1323,7 @@ func _ready() -&gt; void:
<pubDate>Sun, 22 May 2022 01:16:10 GMT</pubDate>
<category>English</category>
<category>Gamedev</category>
+ <category>Godot</category>
<category>Short</category>
<description>Details on the project structure I'm using for Godot, based on preference and some research I did.</description>
<content:encoded><![CDATA[<p>One of my first issues when starting a project is how to structure everything. So I had to spend some time researching best practices and go with what I like the most and after trying some of them I wanted to write down somewhere what I&rsquo;m sticking with.</p>
@@ -1366,12 +1456,14 @@ func _ready() -&gt; void:
<pubDate>Tue, 17 May 2022 05:19:54 GMT</pubDate>
<category>English</category>
<category>Gamedev</category>
+ <category>Godot</category>
<category>Short</category>
<category>Update</category>
<description>Since I'm starting to get more into gamedev stuff, I'll start blogging about it just to keep consistent.</description>
- <content:encoded><![CDATA[<p>I&rsquo;ve been wanting to get into gamedev for a while now, but it&rsquo;s always a pain to stay consistent. I just recently started to get into gamedev again, and this time I&rsquo;m trying to actually do stuff.</p>
+ <content:encoded><![CDATA[<p>I&rsquo;ve been wanting to get into gamedev for a while now, but it&rsquo;s always a pain to stay consistent. I just recently started to get into it again, and this time I&rsquo;m trying to actually do stuff.</p>
<p>So, the plan is to blog about my progress and clone some simple games just to get started. I&rsquo;m thinking on sticking with <a href="https://godotengine.org/">Godot</a> just because I like that it&rsquo;s open source, it&rsquo;s getting better and better overtime (big rewrite happening right now) and I already like how the engine works. <del>Specifically I&rsquo;ll start using <em>Godot 4</em> even though it&rsquo;s not done yet, to get used to the new features, specifically pumped for <a href="https://godotengine.org/article/gdscript-progress-report-feature-complete-40">GDScript 2.0</a>.</del> <ins>Actually&hellip; (for the small clones/ripoffs) I&rsquo;ll need to use <em>Godot 3.X</em> (probably 3.5), as <em>Godot 4</em> doesn&rsquo;t have support to export to webassembly (HTML5) yet, and I want that to publish to <a href="https://itch.io/">itch.io</a> and my website. I&rsquo;ll continue to use <em>Godot 4</em> for bigger projects, as they will take longer and I hope that by the time I need to publish, there&rsquo;s no issues to export.</ins></p>
-<p>For a moment I almost started a new subdomain just for gamedev stuff, but decided to just use a different directory for subtleness; this directory and use of tags should be enough. I&rsquo;ll be posting the entry about the first rip-off I&rsquo;m <em>developing</em> (FlappyBird L O L) shortly.</p>]]></content:encoded>
+<p>For a moment I almost started a new subdomain just for gamedev stuff, but decided to just use a different directory for subtleness; this directory and use of tags should be enough. I&rsquo;ll be posting the entry about the first rip-off I&rsquo;m <em>developing</em> (FlappyBird L O L) shortly.</p>
+<p><strong>Update</strong>: <a href="https://godotengine.org/article/godot-4-0-sets-sail/">Godot 4</a> already released and it now has HTML5 support, so back to the original plan.</p>]]></content:encoded>
</item>
<item>
<title>My setup for a password manager and MFA authenticator</title>
@@ -1383,7 +1475,7 @@ func _ready() -&gt; void:
<category>Tools</category>
<description>A short description on my personal setup regarding a password manager and alternatives to G\*\*gl\* authenticator.</description>
<content:encoded><![CDATA[<p><strong>Disclaimer</strong>: I won&rsquo;t go into many technical details here of how to install/configure/use the software, this is just supposed to be a short description on my setup.</p>
-<p>It&rsquo;s been a while since I started using a password manager at all, and I&rsquo;m happy that I started with <a href="https://keepassxc.org/">KeePassXC</a> (open source, multiplatform password manager that it&rsquo;s completely offline) as a direct recommendation from <a href="https://www.lmcj.xyz/">lm</a>; before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by <a href="https://askleo.com/different-passwords-for-everything/">Leo</a> (I don&rsquo;t personally recommed LastPass as Leo does). Note that you will still need a <em>master password</em> to lock/unlock your password database (you can additionally use a hardware key and a key file).</p>
+<p>It&rsquo;s been a while since I started using a password manager at all, and I&rsquo;m happy that I started with <a href="https://keepassxc.org/">KeePassXC</a> (open source, multiplatform password manager that it&rsquo;s completely offline) as a direct recommendation from <a href="https://www.lmcj.xyz/"><mark>EL ELE EME</mark></a>; before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by <a href="https://askleo.com/different-passwords-for-everything/">Leo</a> (I don&rsquo;t personally recommed LastPass as Leo does). Note that you will still need a <em>master password</em> to lock/unlock your password database (you can additionally use a hardware key and a key file).</p>
<p>Anyways, setting up <em>keepass</em> is pretty simple, as there is a client for almost any device; note that <em>keepass</em> is basically just the format and the base for all of the clients, as its common with pretty much any open source software. In my case I&rsquo;m using <a href="https://keepassxc.org/">KeePassXC</a> in my computer and <a href="https://www.keepassdx.com/">KeePassDX</a> in my phone (Android). The only concern is keeping everything in sync because <em>keepass</em> doesn&rsquo;t have any automatic method of synchronizing between devices because of security reasons (as far as I know), meaning that you have to manage that yourself.</p>
<p>Usually you can use something like G**gl* drive, dropbox, mega, nextcloud, or any other cloud solution that you like to sync your <em>keepass</em> database between devices; I personally prefer to use <a href="https://syncthing.net/">Syncthing</a> as it&rsquo;s open source, it&rsquo;s really easy to setup and has worked wonders for me since I started using it, also it keeps versions of your files that can serve as backups in any scenario where the database gets corrupted or something.</p>
<p>Finally, when I went through the issue with the micro SD and the <em>adoptable storage</em> bullshit (you can find the rant <a href="https://blog.luevano.xyz/a/devs_android_me_trozaron.html">here</a>, in spanish) I had to also migrate from <em>G**gl* authenticator</em> (<em>gauth</em>) to something else for the simple reason that <em>gauth</em> doesn&rsquo;t even let you do backups, nor it&rsquo;s synched with your account&hellip; nothing, it is just standalone and if you ever lose your phone you&rsquo;re fucked; so I decided to go with <a href="https://getaegis.app/">Aegis authenticator</a>, as it is open source, you have control over all your secret keys, you can do backups directly to the filesystem, you can secure your database with an extra password, etc., etc.. In general <em>aegis</em> is the superior MFA authenticator (at least compared with <em>gauth</em>) and everything that&rsquo;s compatible with <em>gauth</em> is compatible with <em>aegis</em> as the format is a standard (as a matter of fact, <em>keepass</em> also has this MFA feature which is called TOPT and is also compatible, but I prefer to have things separate). I also use <em>syncthing</em> to keep a backup of my <em>aegis</em> database.</p>
@@ -1429,15 +1521,16 @@ func _ready() -&gt; void:
<category>Update</category>
<description>Actualización en el estado de la página, después de mucho tiempo de ausencia.</description>
<content:encoded><![CDATA[<p>Después de mucho tiempo de estar luchando con querer volver a usar este pex (maldita <em>d</em> word y demás), ya me volví a acomodar el setup para agregar nuevas entradas.</p>
-<p>Entre las cosas que tuve que hacer fue actualizar el <a href="https://github.com/luevano/pyssg">pyssg</a> porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder <em>buildear</em> la página completa; por ahora se hace en segmentos: todo lo de <a href="https://luevano.xyz">luevano.xyz</a> está hecho manual, mientras que <a href="https://blog.luevano.xyz">blog</a> y <a href="https://art.luevano.xyz">art</a> usan <a href="https://github.com/luevano/pyssghttps://github.com/luevano/pyssg">pyssg</a>.</p>
+<p>Entre las cosas que tuve que hacer fue actualizar el <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder <em>buildear</em> la página completa; por ahora se hace en segmentos: todo lo de <a href="https://luevano.xyz">luevano.xyz</a> está hecho manual, mientras que <a href="https://blog.luevano.xyz">blog</a> y <a href="https://art.luevano.xyz">art</a> usan <a href="https://github.com/luevano/pyssg">pyssg</a>.</p>
<p>Otra cosa es que quizá me devuelva a editar alguans entradas nada más para homogeneizar las entradas específicas a <em>Create a&hellip;</em> (tiene más sentido que sean <em>Setup x&hellip;</em> o algo similar).</p>
-<p>En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno por problemas debidos a varias razones (del jale). Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto <em>*thinking emoji*</em>.</p>]]></content:encoded>
+<p>En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno en el jale. Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto <em>*thinking emoji*</em>.</p>]]></content:encoded>
</item>
<item>
<title>Create a VPN server with OpenVPN (IPv4)</title>
<link>https://blog.luevano.xyz/a/vpn_server_with_openvpn.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/vpn_server_with_openvpn.html</guid>
<pubDate>Sun, 01 Aug 2021 09:27:02 GMT</pubDate>
+ <category>Code</category>
<category>English</category>
<category>Server</category>
<category>Tools</category>
@@ -1445,14 +1538,27 @@ func _ready() -&gt; void:
<description>How to create a VPN server using OpenVPN on a server running Nginx. Only for IPv4.</description>
<content:encoded><![CDATA[<p>I&rsquo;ve been wanting to do this entry, but had no time to do it since I also have to set up the VPN service as well to make sure what I&rsquo;m writing makes sense, today is the day.</p>
<p>Like with any other of my entries I based my setup on the <a href="https://wiki.archlinux.org/title/OpenVPN">Arch Wiki</a>, <a href="https://github.com/Nyr/openvpn-install">this install script</a> and <a href="https://github.com/graysky2/ovpngen">this profile generator script</a>.</p>
-<p>This will be installed and working alongside the other stuff I&rsquo;ve wrote about on other posts (see the <a href="https://blog.luevano.xyz/tag/@server.html">server</a> tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it&rsquo;s not that hard to include IPv6, but meh).</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+<p>This will be installed and working alongside the other stuff I&rsquo;ve wrote about on other posts (see the <a href="https://blog.luevano.xyz/tag/@server.html">server</a> tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it&rsquo;s not that hard to include IPv6, but meh). As always, all commands are executed as root unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#create-pki-from-scratch">Create PKI from scratch</a></li>
+<li><a href="#openvpn">OpenVPN</a><ul>
+<li><a href="#enable-forwarding">Enable forwarding</a></li>
+<li><a href="#create-client-configurations">Create client configurations</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Pretty simple:</p>
<ul>
-<li>Working server with root access, and with Ufw as the firewall.</li>
-<li>Depending on what port you want to run the VPN on, the default <code>1194</code>, or as a fallback on <code>443</code> (click <a href="https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/">here</a> for more). I will do mine on port <code>1194</code> but it&rsquo;s just a matter of changing 2 lines of configuration and one Ufw rule.</li>
+<li>Working server with root access, and with <code>ufw</code> as the firewall.</li>
+<li>Depending on what port you want to run the VPN on, the default <code>1194</code>, or as a fallback on <code>443</code> (click <a href="https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/">here</a> for more). I will do mine on port <code>1194</code> but it&rsquo;s just a matter of changing 2 lines of configuration and one <code>ufw</code> rule.</li>
</ul>
-<h3 id="create-pki-from-scratch">Create PKI from scratch<a class="headerlink" href="#create-pki-from-scratch" title="Permanent link">&para;</a></h3>
+<h2 id="create-pki-from-scratch">Create PKI from scratch<a class="headerlink" href="#create-pki-from-scratch" title="Permanent link">&para;</a></h2>
<p>PKI stands for <em>Public Key Infrastructure</em> and basically it&rsquo;s required for certificates, private keys and more. This is supposed to work between two servers and one client: a server in charge of creating, signing and verifying the certificates, a server with the OpenVPN service running and the client making the request.</p>
<p>This is supposed to work something like: 1) a client wants to use the VPN service, so it creates a requests and sends it to the signing server, 2) this server checks the requests and signs the request, returning the certificates to both the VPN service and the client and 3) the client can now connect to the VPN service using the signed certificate which the OpenVPN server knows about. In a nutshell, I&rsquo;m no expert.</p>
<p>&hellip; but, to be honest, all of this is a hassle and (in my case) I want something simple to use and manage. So I&rsquo;m gonna do all on one server and then just give away the configuration file for the clients, effectively generating files that anyone can run and will work, meaning that you need to be careful who you give this files (it also comes with a revoking mechanism, so no worries).</p>
@@ -1496,8 +1602,8 @@ openssl dhparam -out dh.pem 2048
openvpn --genkey secret ta.key
</code></pre>
<p>That&rsquo;s it for the PKI stuff and general certificate configuration.</p>
-<h3 id="openvpn">OpenVPN<a class="headerlink" href="#openvpn" title="Permanent link">&para;</a></h3>
-<p><a href="https://wiki.archlinux.org/title/OpenVPN">OpenVPN</a> is a robust and highly flexible VPN daemon, that&rsquo;s pretty complete feature wise.</p>
+<h2 id="openvpn">OpenVPN<a class="headerlink" href="#openvpn" title="Permanent link">&para;</a></h2>
+<p><a href="https://wiki.archlinux.org/title/OpenVPN">OpenVPN</a> is a robust and highly flexible VPN daemon, that&rsquo;s pretty complete feature-wise.</p>
<p>Install the <code>openvpn</code> package:</p>
<pre><code class="language-sh">pacman -S openvpn
</code></pre>
@@ -1599,6 +1705,7 @@ verb 3
explicit-exit-notify 1
</code></pre>
<p><code>#</code> and <code>;</code> are comments. Read each and every line, you might want to change some stuff (like the logging), specially the first line which is your server public IP.</p>
+<h4 id="enable-forwarding">Enable forwarding<a class="headerlink" href="#enable-forwarding" title="Permanent link">&para;</a></h4>
<p>Now, we need to enable <em>packet forwarding</em> (so we can access the web while connected to the VPN), which can be enabled on the interface level or globally (you can check the different options with <code>sysctl -a | grep forward</code>). I&rsquo;ll do it globally, run:</p>
<pre><code class="language-sh">sysctl net.ipv4.ip_forward=1
</code></pre>
@@ -1644,7 +1751,7 @@ ufw reload
systemctl enable openvpn-server@server.service
</code></pre>
<p>Where the <code>server</code> after <code>@</code> is the name of your configuration, <code>server.conf</code> without the <code>.conf</code> in my case.</p>
-<h4 id="create-client-configurations">Create client configurations<a class="headerlink" href="#create-client-configurations" title="Permanent link">&para;</a></h4>
+<h3 id="create-client-configurations">Create client configurations<a class="headerlink" href="#create-client-configurations" title="Permanent link">&para;</a></h3>
<p>You might notice that I didn&rsquo;t specify how to actually connect to our server. For that we need to do a few more steps. We actually need a configuration file similar to the <code>server.conf</code> file that we created.</p>
<p>The real way of doing this would be to run similar steps as the ones with <code>easy-rsa</code> locally, send them to the server, sign them, and retrieve them. Nah, we&rsquo;ll just create all configuration files on the server as I was mentioning earlier.</p>
<p>Also, the client configuration file has to match the server one (to some degree), to make this easier you can create a <code>client-common</code> file in <code>/etc/openvpn/server</code> with the following content:</p>
@@ -1717,7 +1824,7 @@ chown nobody:nobody pki/crl.pem
chmod o+r pki/crl.pem
cd $CPWD
</code></pre>
-<p>And the way to use is to run <code>vpn_script new/rev client_name</code> as sudo (when revoking, it doesn&rsquo;t actually deletes the <code>.ovpn</code> file in <code>~/ovpn</code>). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for <code>easy-rsa</code>) and it could have errors.</p>
+<p>And the way to use is to run <code>vpn_script new/rev client_name</code> as sudo (when revoking, it doesn&rsquo;t actually delete the <code>.ovpn</code> file in <code>~/ovpn</code>). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for <code>easy-rsa</code>).</p>
<p>Now, just get the <code>.ovpn</code> file generated, import it to OpenVPN in your client of preference and you should have a working VPN service.</p>]]></content:encoded>
</item>
<item>
@@ -1741,7 +1848,7 @@ cd $CPWD
<p>Y pues ya, este pex ya me sirvió para desahogarme, una disculpa por la redacción tan <em>pitera</em>. Sobres.</p>]]></content:encoded>
</item>
<item>
- <title>Tenia este pex algo descuidado</title>
+ <title>Tenía este pex algo descuidado</title>
<link>https://blog.luevano.xyz/a/tenia_esto_descuidado.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/tenia_esto_descuidado.html</guid>
<pubDate>Sun, 18 Jul 2021 07:51:50 GMT</pubDate>
@@ -1750,10 +1857,10 @@ cd $CPWD
<category>Update</category>
<description>Nada más un update en el estado del blog y lo que he andado haciendo.</description>
<content:encoded><![CDATA[<p>Así es, tenía un poco descuidado este pex, siendo la razón principal que andaba ocupado con cosas de <em>la vida profesional</em>, ayay. Pero ya que ando un poco más despejado y menos estresado voy a seguir usando el blog y a ver qué más hago.</p>
-<p>Tengo unas entradas pendientes que quiero hacer del estilo de &ldquo;tutorial&rdquo; o &ldquo;how-to&rdquo;, pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en <a href="https://landchad.net/">landchad.net</a>, lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por <a href="https://lmcj.xyz/">lm</a>); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he <em>setupeado</em> desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.</p>
-<p>También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el <em>está bien cabrón</em> pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento (sí, me mamé).</p>
+<p>Tengo unas entradas pendientes que quiero hacer del estilo de &ldquo;tutorial&rdquo; o &ldquo;how-to&rdquo;, pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en <a href="https://landchad.net/">landchad.net</a>, lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por <a href="https://lmcj.xyz/"><mark>EL ELE EME</mark></a>); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he <em>setupeado</em> desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.</p>
+<p>También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el <em>está bien cabrón</em> pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento.</p>
<p>Algo bueno es que me he estado sintiendo muy bien conmigo mismo últimamente, aunque casi no hable de eso. Sí hay una razón en específico, pero es una razón algo tonta. Espero así siga.</p>
-<p>Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien <em>bloated</em>, entonces pues me voy a hacer una en corto seguramente en Python para <em>el back</em>, MySQL para la base de datos y Javascript para la conexión acá en <em>el front</em>, algo tranqui.</p>
+<p><del>Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien <em>bloated</em>, entonces pues me voy a hacer una en corto seguramente en Python para <em>el back</em>, MySQL para la base de datos y Javascript para la conexión acá en <em>el front</em>, algo tranqui.</del> <ins>Nel, siempre no ocupo esto, pa&rsquo; qué.</ins></p>
<p>Sobres pues.</p>]]></content:encoded>
</item>
<item>
@@ -1761,15 +1868,28 @@ cd $CPWD
<link>https://blog.luevano.xyz/a/xmpp_server_with_prosody.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/xmpp_server_with_prosody.html</guid>
<pubDate>Wed, 09 Jun 2021 05:24:30 GMT</pubDate>
+ <category>Code</category>
<category>English</category>
<category>Server</category>
<category>Tools</category>
<category>Tutorial</category>
<description>How to create an XMPP server using Prosody on a server running Nginx. This server will be compatible with at least Conversations and Movim.</description>
- <content:encoded><![CDATA[<p>Recently I set up an XMPP server (and a Matrix one, too) for my personal use and for friends if they want one; made one for <mark><a href="https://lmcj.xyz">EL ELE EME</a></mark> for example. So, here are the notes on how I set up the server that is compatible with the <a href="https://conversations.im/">Conversations</a> app and the <a href="https://movim.eu/">Movim</a> social network. You can see my addresses in <a href="https://luevano.xyz/contact.html">contact</a> and the XMPP compliance/score of the server.</p>
-<p>One of the best resources I found that helped me a lot was <a href="https://community.hetzner.com/tutorials/prosody-debian9">Installing and Configuring Prosody XMPP Server on Debian 9</a>, and of course the <a href="https://wiki.archlinux.org/title/Prosody">Arch Wiki</a> and the <a href="https://prosody.im/">oficial documentation</a>.</p>
-<p>As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root (unless specified otherwise)</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <content:encoded><![CDATA[<p><strong>Update</strong>: I no longer host this XMPP server as it consumed a lot of resources and I wasn&rsquo;t using it that much. I&rsquo;ll probably re-create it in the future, though.</p>
+<p>Recently I set up an <a href="https://xmpp.org/">XMPP</a> server (and a Matrix one, too) for my personal use and for friends if they want one; made one for <a href="https://lmcj.xyz"><mark>EL ELE EME</mark></a> for example. So, here are the notes on how I set up the server that is compatible with the <a href="https://conversations.im/">Conversations</a> app and the <a href="https://movim.eu/">Movim</a> social network. You can see my addresses at <a href="https://luevano.xyz/contact.html">contact</a> and the XMPP compliance/score of the server.</p>
+<p>One of the best resources I found that helped me a lot was <a href="https://community.hetzner.com/tutorials/prosody-debian9">Installing and Configuring Prosody XMPP Server on Debian 9</a>, the <a href="https://wiki.archlinux.org/title/Prosody">Arch Wiki</a> and the <a href="https://prosody.im/">oficial documentation</a>.</p>
+<p>As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root, unless specified otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#prosody">Prosody</a></li>
+<li><a href="#nginx-configuration-file">Nginx configuration file</a></li>
+<li><a href="#coturn">Coturn</a></li>
+<li><a href="#wrapping-up">Wrapping up</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Same as with my other entries (<a href="https://luevano.xyz/a/website_with_nginx.html">website</a>, <a href="https://blog.luevano.xyz/a/mail_server_with_postfix.html">mail</a> and <a href="https://blog.luevano.xyz/a/git_server_with_cgit.html">git</a>) plus:</p>
<ul>
<li><strong>A</strong> and (optionally) <strong>AAA</strong> DNS records for:<ul>
@@ -1781,16 +1901,16 @@ cd $CPWD
</ul>
</li>
<li>(Optionally, but recommended) the following <strong>SRV</strong> DNS records; make sure it is pointing to an <strong>A</strong> or <strong>AAA</strong> record (matching the records from the last point, for example):<ul>
-<li><code>_xmpp-client._tcp.**your.domain**.</code> for port <code>5222</code> pointing to <code>xmpp.**your.domain**.</code></li>
-<li><code>_xmpp-server._tcp.**your.domain**.</code> for port <code>5269</code> pointing to <code>xmpp.**your.domain**.</code></li>
-<li><code>_xmpp-server._tcp.muc.**your.domain**.</code> for port <code>5269</code> pointing to <code>xmpp.**your.domain**.</code></li>
+<li><code>_xmpp-client._tcp.{your.domain}.</code> for port <code>5222</code> pointing to <code>xmpp.{your.domain}.</code></li>
+<li><code>_xmpp-server._tcp.{your.domain}.</code> for port <code>5269</code> pointing to <code>xmpp.{your.domain}.</code></li>
+<li><code>_xmpp-server._tcp.muc.{your.domain}.</code> for port <code>5269</code> pointing to <code>xmpp.{your.domain}.</code></li>
</ul>
</li>
<li>SSL certificates for the previous subdomains; similar that with my other entries just create the appropriate <code>prosody.conf</code> (where <code>server_name</code> will be all the subdomains defined above) file and run <code>certbot --nginx</code>. You can find the example configuration file almost at the end of this entry.</li>
<li>Email addresses for <code>admin</code>, <code>abuse</code>, <code>contact</code>, <code>security</code>, etc. Or use your own email for all of them, doesn&rsquo;t really matter much as long as you define them in the configuration and are valid, I have aliases so those emails are forwarded to me.</li>
<li>Allow ports <code>5000</code>, <code>5222</code>, <code>5269</code>, <code>5280</code> and <code>5281</code> for <a href="https://prosody.im/doc/ports">Prosody</a> and, <code>3478</code> and <code>5349</code> for <a href="https://webrtc.org/getting-started/turn-server">Turnserver</a> which are the defaults for <code>coturn</code>.</li>
</ul>
-<h3 id="prosody">Prosody<a class="headerlink" href="#prosody" title="Permanent link">&para;</a></h3>
+<h2 id="prosody">Prosody<a class="headerlink" href="#prosody" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Prosody">Prosody</a> is an implementation of the XMPP protocol that is flexible and extensible.</p>
<p>Install the <code>prosody</code> package (with optional dependencies) and the <code>mercurial</code> package:</p>
<pre><code class="language-sh">pacman -S prosody, mercurial, lua52-sec, lua52-dbi, lua52-zlib
@@ -1802,11 +1922,11 @@ mkdir modules-enabled
</code></pre>
<p>You can see that I follow a similar approach that I used with Nginx and the server configuration, where I have all the modules available in a directory, and make a symlink to another to keep track of what is being used. You can update the repository by running <code>hg pull --update</code> while inside the <code>modules-available</code> directory (similar to Git).</p>
<p>Make symbolic links to the following modules:</p>
-<pre><code>ln -s /var/lib/prosody/modules-available/MODULE_NAME /var/lib/prosody/modules-enabled/
+<pre><code>ln -s /var/lib/prosody/modules-available/{module_name} /var/lib/prosody/modules-enabled/
...
</code></pre>
<ul>
-<li>Modules:<ul>
+<li>Modules (<code>{module_name}</code>):<ul>
<li><code>mod_bookmarks</code></li>
<li><code>mod_cache_c2s_caps</code></li>
<li><code>mod_checkcerts</code></li>
@@ -2134,8 +2254,8 @@ ln -s your.domain.key SUBDOMAIN.your.domain.key
...
</code></pre>
<p>That&rsquo;s basically all the configuration that needs Prosody itself, but we still have to configure Nginx and Coturn before starting/enabling the <code>prosody</code> service.</p>
-<h3 id="nginx-configuration-file">Nginx configuration file<a class="headerlink" href="#nginx-configuration-file" title="Permanent link">&para;</a></h3>
-<p>Since this is not an ordinary configuration file I&rsquo;m going to describe this too. Your <code>prosody.conf</code> file should have the following location blocks under the main server block (the one that listens to HTTPS):</p>
+<h2 id="nginx-configuration-file">Nginx configuration file<a class="headerlink" href="#nginx-configuration-file" title="Permanent link">&para;</a></h2>
+<p>Since this is not an ordinary configuration file I&rsquo;m going to describe this, too. Your <code>prosody.conf</code> file should have the following location blocks under the main server block (the one that listens to HTTPS):</p>
<pre><code class="language-nginx"># HTTPS server block
server {
root /var/www/prosody/;
@@ -2228,11 +2348,11 @@ server {
]
}
</code></pre>
-<p>Remember to have your <code>prosody.conf</code> file symlinked (or discoverable by Nginx) to the <code>sites-enabled</code> directory. You can now restart your <code>nginx</code> service (and test the configuration, optionally):</p>
+<p>Remember to have your <code>prosody.conf</code> file symlinked (or discoverable by Nginx) to the <code>sites-enabled</code> directory. You can now test and restart your <code>nginx</code> service (and test the configuration, optionally):</p>
<pre><code class="language-sh">nginx -t
systemctl restart nginx.service
</code></pre>
-<h3 id="coturn">Coturn<a class="headerlink" href="#coturn" title="Permanent link">&para;</a></h3>
+<h2 id="coturn">Coturn<a class="headerlink" href="#coturn" title="Permanent link">&para;</a></h2>
<p><a href="https://github.com/coturn/coturn">Coturn</a> is the implementation of TURN and STUN server, which in general is for (at least in the XMPP world) voice support and external service discovery.</p>
<p>Install the <code>coturn</code> package:</p>
<pre><code class="language-sh">pacman -S coturn
@@ -2248,7 +2368,7 @@ static-auth-secret=YOUR SUPER SECRET TURN PASSWORD
systemctl enable turnserver.service
</code></pre>
<p>You can test if your TURN server works at <a href="https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/">Trickle ICE</a>. You may need to add a user in the <code>turnserver.conf</code> to test this.</p>
-<h3 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h3>
+<h2 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h2>
<p>At this point you should have a working XMPP server, start/enable the <code>prosody</code> service now:</p>
<pre><code class="language-sh">systemctl start prosody.service
systemctl enable prosody.service
@@ -2261,7 +2381,7 @@ systemctl enable prosody.service
<p>Additionally, you can test the security of your server in <a href="https://xmpp.net/index.php">IM Observatory</a>, here you only need to specify your <code>domain.name</code> (not <code>xmpp.domain.name</code>, if you set up the <strong>SRV</strong> DNS records correctly). Again, it should have a similar score to mine:</p>
<p><a href='https://xmpp.net/result.php?domain=luevano.xyz&amp;type=client'><img src='https://xmpp.net/badge.php?domain=luevano.xyz' alt='xmpp.net score' /></a></p>
<p>You can now log in into your XMPP client of choice, if it asks for the server it should be <code>xmpp.your.domain</code> (or <code>your.domain</code> for some clients) and your login credentials <code>you@your.domain</code> and the password you chose (which you can change in most clients).</p>
-<p>That&rsquo;s it, send me a message <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.</p>]]></content:encoded>
+<p>That&rsquo;s it, send me a message at <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.</p>]]></content:encoded>
</item>
<item>
<title>Al fin ya me acomodé la página pa' los dibujos</title>
@@ -2273,7 +2393,7 @@ systemctl enable prosody.service
<category>Update</category>
<description>Actualización en el estado de la página, en este caso sobre la existencia de una nueva página para los dibujos y arte en general.</description>
<content:encoded><![CDATA[<p>Así es, ya quedó acomodado el sub-dominio <code>art.luevano.xyz</code> pos pal <a href="https://art.luevano.xyz">arte</a> veda. Entonces pues ando feliz por eso.</p>
-<p>Este pedo fue gracias a que me reescribí la forma en la que <code>pyssg</code> maneja los templates, ahora uso el sistema de <code>jinja</code> en vez del cochinero que hacía antes.</p>
+<p>Este pedo fue gracias a que me reescribí la forma en la que <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> maneja los templates, ahora uso el sistema de <a href="https://jinja.palletsprojects.com/en/3.1.x/"><code>jinja</code></a> en vez del cochinero que hacía antes.</p>
<p>Y pues nada más eso, aquí está el <a href="https://art.luevano.xyz/a/elephant_octopus.html">primer post</a> y por supuesto acá está el link del RSS <a href="https://art.luevano.xyz/rss.xml">https://art.luevano.xyz/rss.xml</a>.</p>]]></content:encoded>
</item>
<item>
@@ -2288,8 +2408,9 @@ systemctl enable prosody.service
<content:encoded><![CDATA[<p>Estuve acomodando un poco más el <em>sItIo</em>, al fin agregué la &ldquo;sección&rdquo; de <a href="https://luevano.xyz/contact.html">contact</a> y de <a href="https://luevano.xyz/donate.html">donate</a> por si hay algún loco que quiere tirar varo.</p>
<p>También me puse a acomodar un servidor de <a href="https://xmpp.org/">XMPP</a> el cual, en pocas palabras, es un protocolo de mensajería instantánea (y más) descentralizado, por lo cual cada quien puede hacer una cuenta en el servidor que quiera y conectarse con cuentas creadas en otro servidor&hellip; exacto, como con los correos electrónicos. Y esto está perro porque si tú tienes tu propio server, así como con uno de correo electrónico, puedes controlar qué características tiene, quiénes pueden hacer cuenta, si hay <em>end-to-end encryption</em> (o mínimo <em>end-to-server</em>), entre un montón de otras cosas.</p>
<p>Ahorita este server es SUMISO (<em>compliant</em> en español, jeje) para jalar con la app <a href="https://conversations.im/">conversations</a> y con la red social <a href="https://movim.eu/">movim</a>, pero realmente funcionaría con casi cualquier cliente de XMPP, amenos que ese cliente implemente algo que no tiene mi server. Y también acomodé un server de <a href="https://matrix.org/">Matrix</a> que es muy similar pero es bajo otro protocolo y se siente más como un discord/slack (al menos en el <a href="https://element.io/">element</a>), muy chingón también.</p>
-<p>Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el <a href="https://github.com/luevano/pyssg">pyssg</a> para que jale chido para este pex.</p>
-<p>Ya por último también quiero moverle un poco al CSS, porque lo dejé en un estado muy culerón y quiero meterle/ajustar unas cosas para que quede más limpio y medianamente bonito&hellip; <em>dentro de lo que cabe porque evidentemente me vale verga si se ve como una página del 2000</em>.</p>]]></content:encoded>
+<p>Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> para que jale chido para este pex.</p>
+<p>Ya por último también quiero moverle un poco al CSS, porque lo dejé en un estado muy culerón y quiero meterle/ajustar unas cosas para que quede más limpio y medianamente bonito&hellip; <em>dentro de lo que cabe porque evidentemente me vale verga si se ve como una página del 2000</em>.</p>
+<p><strong>Actualización</strong>: Ya tumbé el servidor de XMPP porque consumía bastantes recursos y no lo usaba tanto, si en un futuro consigo un mejor servidor podría volver a hostearlo.</p>]]></content:encoded>
</item>
<item>
<title>I'm using a new blogging system</title>
@@ -2305,28 +2426,42 @@ systemctl enable prosody.service
<p>The solution? Write a new program &ldquo;from scratch&rdquo; in <em>pYtHoN</em>. Yes it is bloated, yes it is in its early stages, but it works just as I want it to work, and I&rsquo;m pretty happy so far with the results and have with even more ideas in mind to &ldquo;optimize&rdquo; and generally clean my wOrKfLoW to post new blog entries. I even thought of using it for posting into a &ldquo;feed&rdquo; like gallery for drawings or pictures in general.</p>
<p>I called it <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, because it sounds nice and it wasn&rsquo;t taken in the PyPi. It is just a terminal program that reads either a configuration file or the options passed as flags when calling the program.</p>
<p>It still uses Markdown files because I find them very easy to work with. And instead of just having a &ldquo;header&rdquo; and a &ldquo;footer&rdquo; applied to each parsed entry, you will have templates (generated with the program) for each piece that I thought made sense (idea taken from <code>blogit</code>): the common header and footer, the common header and footer for each entry and, header, footer and list elements for articles and tags. When parsing the Markdown file these templates are applied and stitched together to make a single HTML file. Also generates an RSS feed and the <code>sitemap.xml</code> file, which is nice.</p>
-<p>It might sound convoluted, but it works pretty well, with of course room to improve; I&rsquo;m open to suggestions, issue reporting or direct contributions <a href="https://github.com/luevano/pyssg">here</a>. BTW, it only works on Linux for now (and don&rsquo;t think on making it work on windows, but feel free to do PR for the compatibility).</p>
-<p>That&rsquo;s it for now, the new RSS feed is available here: <a href="https://blog.luevano.xyz/rss.xml">https://blog.luevano.xyz/rss.xml</a>.</p>]]></content:encoded>
+<p>It might sound convoluted, but it works pretty well, with of course room to improve; I&rsquo;m open to suggestions, issue reporting or direct contributions <a href="https://github.com/luevano/pyssg">here</a>. For now, it is only tested on Linux (and don&rsquo;t think on making it work on windows, but feel free to do PR for the compatibility).</p>
+<p>That&rsquo;s it for now, the new RSS feed is available here: <a href="https://blog.luevano.xyz/rss.xml">https://blog.luevano.xyz/rss.xml</a>.</p>
+<p><strong>Update</strong>: Since writing this entry, <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a> has evolved quite a bit, so not everything described here is still true. For the latest updates check the newest entries or the git repository itself.</p>]]></content:encoded>
</item>
<item>
<title>Create a git server and setup cgit web app (on Nginx)</title>
<link>https://blog.luevano.xyz/a/git_server_with_cgit.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/git_server_with_cgit.html</guid>
<pubDate>Sun, 21 Mar 2021 19:00:29 GMT</pubDate>
+ <category>Code</category>
<category>English</category>
<category>Server</category>
<category>Tools</category>
<category>Tutorial</category>
<description>How to create a git server using cgit on a server running Nginx. This is a follow up on post about creating a website with Nginx and Certbot.</description>
- <content:encoded><![CDATA[<p>My git server is all I need to setup to actually <em>kill</em> my other server (I&rsquo;ve been moving from servers on these last 2-3 blog entries), that&rsquo;s why I&rsquo;m already doing this entry. I&rsquo;m basically following <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server">git&rsquo;s guide on setting up a server</a> plus some specific stuff for (btw i use) Arch Linux (<a href="https://wiki.archlinux.org/index.php/Git_server#Web_interfaces">Arch Linux Wiki: Git server</a> and <a href="https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/">Step by step guide on setting up git server in arch linux (pushable)</a>).</p>
-<p>Note that this is mostly for personal use, so there&rsquo;s no user/authentication control other than that of SSH. Also, most if not all commands here are run as root.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <content:encoded><![CDATA[<p>My git server is all I need to setup to actually <em>kill</em> my other server (I&rsquo;ve been moving from servers on these last 2-3 blog entries), that&rsquo;s why I&rsquo;m already doing this entry. I&rsquo;m basically following <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server">git&rsquo;s guide on setting up a server</a> plus some specific stuff for <mark>btw i use</mark> Arch Linux (<a href="https://wiki.archlinux.org/index.php/Git_server#Web_interfaces">Arch Linux Wiki: Git server</a> and <a href="https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/">Step by step guide on setting up git server in arch linux (pushable)</a>).</p>
+<p>Note that this is mostly for personal use, so there&rsquo;s no user/authentication control other than that of normal <code>ssh</code>. And as with the other entries, most if not all commands here are run as root unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#git">Git</a></li>
+<li><a href="#cgit">Cgit</a><ul>
+<li><a href="#cgits-file-rendering">Cgit&rsquo;s file rendering</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>I might get tired of saying this (it&rsquo;s just copy paste, basically)&hellip; but you will need the same prerequisites as before (check my <a href="https://blog.luevano.xyz/a/website_with_nginx.html">website</a> and <a href="https://blog.luevano.xyz/a/mail_server_with_postfix.html">mail</a> entries), with the extras:</p>
<ul>
<li>(Optional, if you want a &ldquo;front-end&rdquo;) A <strong>CNAME</strong> for &ldquo;git&rdquo; and (optionally) &ldquo;www.git&rdquo;, or some other name for your sub-domains.</li>
<li>An SSL certificate, if you&rsquo;re following the other entries, add a <code>git.conf</code> and run <code>certbot --nginx</code> to extend the certificate.</li>
</ul>
-<h3 id="git">Git<a class="headerlink" href="#git" title="Permanent link">&para;</a></h3>
+<h2 id="git">Git<a class="headerlink" href="#git" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/git">Git</a> is a version control system.</p>
<p>If not installed already, install the <code>git</code> package:</p>
<pre><code class="language-sh">pacman -S git
@@ -2360,11 +2495,11 @@ systemctl enable git-daemon.socket
</code></pre>
<p>You&rsquo;re basically done. Now you should be able to push/pull repositories to your server&hellip; except, you haven&rsquo;t created any repository in your server, that&rsquo;s right, they&rsquo;re not created automatically when trying to push. To do so, you have to run (while inside <code>/home/git</code>):</p>
<pre><code class="language-sh">git init --bare {repo_name}.git
-chown -R git:git repo_name.git
+chown -R git:git {repo_name}.git
</code></pre>
-<p>Those two lines above will need to be run each time you want to add a new repository to your server (yeah, kinda lame&hellip; although there are options to &ldquo;automate&rdquo; this, I like it this way).</p>
+<p><mark>Those two lines above will need to be run each time you want to add a new repository to your server</mark>. There are options to &ldquo;automate&rdquo; this but I like it this way.</p>
<p>After that you can already push/pull to your repository. I have my repositories (locally) set up so I can push to more than one remote at the same time (my server, GitHub, GitLab, etc.); to do so, check <a href="https://gist.github.com/rvl/c3f156e117e22a25f242">this gist</a>.</p>
-<h3 id="cgit">Cgit<a class="headerlink" href="#cgit" title="Permanent link">&para;</a></h3>
+<h2 id="cgit">Cgit<a class="headerlink" href="#cgit" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Cgit">Cgit</a> is a fast web interface for git.</p>
<p>This is optionally since it&rsquo;s only for the web application.</p>
<p>Install the <code>cgit</code> and <code>fcgiwrap</code> packages:</p>
@@ -2405,10 +2540,9 @@ repo.url={url}
repo.path={dir_path}
repo.owner={owner}
repo.desc={short_description}
-
...
</code></pre>
-<p>Where you can uncomment the <code>robots</code> line to let web crawlers (like Google&rsquo;s) to index your <code>git</code> web app. And at the end keep all your repositories (the ones you want to make public), for example for my <a href="https://git.luevano.xyz/.dots"><em>dotfiles</em></a> I have:</p>
+<p>Where you can uncomment the <code>robots</code> line to not let web crawlers (like Google&rsquo;s) to index your <code>git</code> web app. And at the end keep all your repositories (the ones you want to make public), for example for my <a href="https://git.luevano.xyz/.dots"><em>dotfiles</em></a> I have:</p>
<pre><code class="language-apache">...
repo.url=.dots
repo.path=/home/git/.dots.git
@@ -2417,6 +2551,7 @@ repo.desc=These are my personal dotfiles.
...
</code></pre>
<p>Otherwise you could let <code>cgit</code> to automatically detect your repositories (you have to be careful if you want to keep &ldquo;private&rdquo; repos) using the option <code>scan-path</code> and setup <code>.git/description</code> for each repository. For more, you can check <a href="https://man.archlinux.org/man/cgitrc.5">cgitrc(5)</a>.</p>
+<h3 id="cgits-file-rendering">Cgit&rsquo;s file rendering<a class="headerlink" href="#cgits-file-rendering" title="Permanent link">&para;</a></h3>
<p>By default you can&rsquo;t see the files on the site, you need a highlighter to render the files, I use <code>highlight</code>. Install the <code>highlight</code> package:</p>
<pre><code class="language-sh">pacman -S highlight
</code></pre>
@@ -2442,21 +2577,37 @@ exec highlight --force --inline-css -f -I -O xhtml -S &quot;$EXTENSION&quot; 2&g
<link>https://blog.luevano.xyz/a/mail_server_with_postfix.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/mail_server_with_postfix.html</guid>
<pubDate>Sun, 21 Mar 2021 04:05:59 GMT</pubDate>
+ <category>Code</category>
<category>English</category>
<category>Server</category>
<category>Tools</category>
<category>Tutorial</category>
<description>How to create mail server using Postfix, Dovecot, SpamAssassin and OpenDKIM. This is a follow up on post about creating a website with Nginx and Certbot.</description>
- <content:encoded><![CDATA[<p>The entry is going to be long because it&rsquo;s a <em>tedious</em> process. This is also based on <a href="https://github.com/LukeSmithxyz/emailwiz">Luke Smith&rsquo;s script</a>, but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I&rsquo;m in the process of installing/configuring the mail server on a new VPS of mine; also I&rsquo;m going to be writing a script that does everything in one go (for Arch Linux), that will be hosted <a href="https://git.luevano.xyz/server_scripts.git">here</a>.</p>
-<p>This configuration works for local users (users that appear in <code>/etc/passwd</code>), and does not use any type of SQL Database. And note that most if not all commands executed here are run with root privileges.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+ <content:encoded><![CDATA[<p>The entry is going to be long because it&rsquo;s a <em>tedious</em> process. This is also based on <a href="https://github.com/LukeSmithxyz/emailwiz">Luke Smith&rsquo;s script</a>, but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I&rsquo;m in the process of installing/configuring the mail server on a new VPS of mine; <del>also I&rsquo;m going to be writing a script that does everything in one go (for Arch Linux), that will be hosted <a href="https://git.luevano.xyz/server_scripts.git">here</a>.</del> <ins>I haven&rsquo;t had time to do the script so nevermind this, if I ever do it I&rsquo;ll make a new entry regarding it.</ins></p>
+<p>This configuration works for local users (users that appear in <code>/etc/passwd</code>), and does not use any type of SQL database. And note that most if not all commands executed here are run with root privileges, unless stated otherwise.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#postfix">Postfix</a></li>
+<li><a href="#dovecot">Dovecot</a></li>
+<li><a href="#opendkim">OpenDKIM</a><ul>
+<li><a href="#opendkim-dns-txt-records">OpenDKIM DNS TXT records</a></li>
+</ul>
+</li>
+<li><a href="#spamassassin">SpamAssassin</a></li>
+<li><a href="#wrapping-up">Wrapping up</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>Basically the same as with the <a href="https://blog.luevano.xyz/a/website_with_nginx.html">website with Nginx and Certbot</a>, with the extras:</p>
<ul>
<li>You will need a <strong>CNAME</strong> for &ldquo;mail&rdquo; and (optionally) &ldquo;www.mail&rdquo;, or whatever you want to call the sub-domains (although the <a href="https://tools.ietf.org/html/rfc2181#section-10.3">RFC 2181</a> states that it NEEDS to be an <strong>A</strong> record, fuck the police).</li>
<li>An SSL certificate. You can use the SSL certificate obtained following my last post using <code>certbot</code> (just create a <code>mail.conf</code> and run <code>certbot --nginx</code> again).</li>
-<li>Ports 25, 587 (SMTP), 465 (SMTPS), 143 (IMAP) and 993 (IMAPS) open on the firewall.</li>
+<li>Ports <code>25</code>, <code>587</code> (SMTP), <code>465</code> (SMTPS), <code>143</code> (IMAP) and <code>993</code> (IMAPS) open on the firewall (I use <code>ufw</code>).</li>
</ul>
-<h3 id="postfix">Postfix<a class="headerlink" href="#postfix" title="Permanent link">&para;</a></h3>
+<h2 id="postfix">Postfix<a class="headerlink" href="#postfix" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/postfix">Postfix</a> is a &ldquo;mail transfer agent&rdquo; which is the component of the mail server that receives and sends emails via SMTP.</p>
<p>Install the <code>postfix</code> package:</p>
<pre><code class="language-sh">pacman -S postfix
@@ -2493,7 +2644,7 @@ smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
</code></pre>
-<p>Specify the mailbox home (this is going to be a directory inside your user&rsquo;s home containing the actual mail files):</p>
+<p>Specify the mailbox home, this is going to be a directory inside your user&rsquo;s home containing the actual mail files, for example it will end up being<code>/home/david/Mail/Inbox</code>:</p>
<pre><code class="language-apache">home_mailbox = Mail/Inbox/
</code></pre>
<p>Pre-configuration to work seamlessly with <code>dovecot</code> and <code>opendkim</code>:</p>
@@ -2507,8 +2658,7 @@ smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = inet:127.0.0.1:8891
mailbox_command = /usr/lib/dovecot/deliver
</code></pre>
-<p>Where <code>{yourdomainname}</code> is <code>luevano.xyz</code> in my case, or if you have <code>localhost</code> configured to your domain, then use <code>localhost</code> for <code>myhostname</code> (<code>myhostname = localhost</code>).</p>
-<p>Lastly, if you don&rsquo;t want the sender&rsquo;s IP and user agent (application used to send the mail), add the following line:</p>
+<p>Where <code>{yourdomainname}</code> is <code>luevano.xyz</code> in my case. Lastly, if you don&rsquo;t want the sender&rsquo;s IP and user agent (application used to send the mail), add the following line:</p>
<pre><code class="language-apache">smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
</code></pre>
<p>And create the <code>/etc/postfix/smtp_header_checks</code> file with the following content:</p>
@@ -2545,7 +2695,7 @@ newaliases
<pre><code class="language-sh">systemctl start postfix.service
systemctl enable postfix.service
</code></pre>
-<h3 id="dovecot">Dovecot<a class="headerlink" href="#dovecot" title="Permanent link">&para;</a></h3>
+<h2 id="dovecot">Dovecot<a class="headerlink" href="#dovecot" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Dovecot">Dovecot</a> is an IMAP and POP3 server, which is what lets an email application retrieve the mail.</p>
<p>Install the <code>dovecot</code> and <code>pigeonhole</code> (sieve for <code>dovecot</code>) packages:</p>
<pre><code class="language-sh">pacman -S dovecot pigeonhole
@@ -2660,8 +2810,8 @@ account required pam_unix.so
<pre><code class="language-sh">systemctl start dovecot.service
systemctl enable dovecot.service
</code></pre>
-<h3 id="opendkim">OpenDKIM<a class="headerlink" href="#opendkim" title="Permanent link">&para;</a></h3>
-<p><a href="https://wiki.archlinux.org/title/OpenDKIM">OpenDKIM</a> is needed so services like G**gle (we don&rsquo;t mention that name here [[[this is a meme]]]) don&rsquo;t throw the mail to the trash. DKIM stands for &ldquo;DomainKeys Identified Mail&rdquo;.</p>
+<h2 id="opendkim">OpenDKIM<a class="headerlink" href="#opendkim" title="Permanent link">&para;</a></h2>
+<p><a href="https://wiki.archlinux.org/title/OpenDKIM">OpenDKIM</a> is needed so services like G**gle don&rsquo;t throw the mail to the trash. DKIM stands for &ldquo;DomainKeys Identified Mail&rdquo;.</p>
<p>Install the <code>opendkim</code> package:</p>
<pre><code class="language-sh">pacman -S opendkim
</code></pre>
@@ -2710,7 +2860,8 @@ chmod g+r /etc/postfix/dkim/*
<pre><code class="language-sh">systemctl start opendkim.service
systemctl enable opendkim.service
</code></pre>
-<p>And don&rsquo;t forget to add the following <strong>TXT</strong> records on your domain registrar (these examples are for Epik):</p>
+<h3 id="opendkim-dns-txt-records">OpenDKIM DNS TXT records<a class="headerlink" href="#opendkim-dns-txt-records" title="Permanent link">&para;</a></h3>
+<p>Add the following <strong>TXT</strong> records on your domain registrar (these examples are for Epik):</p>
<ol>
<li><em>DKIM</em> entry: look up your <code>{yoursubdomain}.txt</code> file, it should look something like:</li>
</ol>
@@ -2718,7 +2869,7 @@ systemctl enable opendkim.service
&quot;p=...&quot;
&quot;...&quot; ) ; ----- DKIM key mail for {yourdomain}
</code></pre>
-<p>In the TXT record you will place <code>{yoursubdomain}._domainkey</code> as the &ldquo;Host&rdquo; and <code>"v=DKIM1; k=rsa; s=email; " "p=..." "..."</code> in the &ldquo;TXT Value&rdquo; (replace the dots with the actual value you see in your file).</p>
+<p>In the <strong>TXT</strong> record you will place <code>{yoursubdomain}._domainkey</code> as the &ldquo;Host&rdquo; and <code>"v=DKIM1; k=rsa; s=email; " "p=..." "..."</code> in the &ldquo;TXT Value&rdquo; (replace the dots with the actual value you see in your file).</p>
<ol start="2">
<li>
<p><em>DMARC</em> entry: just <code>_dmarc.{yourdomain}</code> as the &ldquo;Host&rdquo; and <code>"v=DMARC1; p=reject; rua=mailto:dmarc@{yourdomain}; fo=1"</code> as the &ldquo;TXT Value&rdquo;.</p>
@@ -2728,7 +2879,7 @@ systemctl enable opendkim.service
</li>
</ol>
<p>And at this point you could test your mail for spoofing and more.</p>
-<h3 id="spamassassin">SpamAssassin<a class="headerlink" href="#spamassassin" title="Permanent link">&para;</a></h3>
+<h2 id="spamassassin">SpamAssassin<a class="headerlink" href="#spamassassin" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/SpamAssassin">SpamAssassin</a> is just <em>a mail filter to identify spam</em>.</p>
<p>Install the <code>spamassassin</code> package (which will install a bunch of ugly <code>perl</code> packages&hellip;):</p>
<pre><code class="language-sh">pacman -S spamassassin
@@ -2781,10 +2932,10 @@ ExecStart=/usr/bin/vendor_perl/spamd -x -u spamd -g spamd --listen=/run/spamd/sp
<pre><code class="language-sh">systemctl start spamassassin.service
systemctl enable spamassassin.service
</code></pre>
-<h3 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h3>
-<p>We should have a working mail server by now. Before continuing check your journal logs (<code>journalctl -xe --unit={unit}</code>, where <code>{unit}</code> could be <code>spamassassin.service</code> for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere (the logs are generally really descriptive) because all the settings and steps detailed here just (literally just finished doing everything on a new server as of the writing of this text) worked <em>(((it just werks on my machine)))</em>.</p>
+<h2 id="wrapping-up">Wrapping up<a class="headerlink" href="#wrapping-up" title="Permanent link">&para;</a></h2>
+<p>We should have a working mail server by now. Before continuing check your journal logs (<code>journalctl -xe --unit={unit}</code>, where <code>{unit}</code> could be <code>spamassassin.service</code> for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere because all the settings and steps detailed here just worked; I literally just finished doing everything on a new server as of the writing of this text, <mark>it just werks on my machine</mark>.</p>
<p>Now, to actually use the mail service: first of all, you need a <em>normal</em> account (don&rsquo;t use root) that belongs to the <code>mail</code> group (<code>gpasswd -a user group</code> to add a user <code>user</code> to group <code>group</code>) and that has a password.</p>
-<p>Next, to actually login into a mail app/program/whateveryouwanttocallit, you will use the following settings, at least for <code>thunderdbird</code>(I tested in windows default mail app and you don&rsquo;t need a lot of settings):</p>
+<p>Next, to actually login into a mail app/program, you will use the following settings, at least for <code>thunderdbird</code>(I tested in windows default mail app and you don&rsquo;t need a lot of settings):</p>
<ul>
<li>* server: subdomain.domain (mail.luevano.xyz in my case)</li>
<li><strong>SMTP</strong> port: 587</li>
@@ -2798,38 +2949,47 @@ systemctl enable spamassassin.service
</ul>
<p>All that&rsquo;s left to do is test your mail server for spoofing, and to see if everything is setup correctly. Go to <a href="https://www.appmaildev.com/en/dkim">DKIM Test</a> and follow the instructions (basically click next, and send an email with whatever content to the email that they provide). After you send the email, you should see something like:</p>
<figure id="__yafg-figure-3">
-<img alt="DKIM Test successful" src="images/b/notes/mail/dkim_test_successful.png" title="DKIM Test successful">
+<img alt="DKIM Test successful" src="https://static.luevano.xyz/images/b/notes/mail/dkim_test_successful.png" title="DKIM Test successful">
<figcaption>DKIM Test successful</figcaption>
-</figure>
-<p>Finally, that&rsquo;s actually it for this entry, if you have any problem whatsoever you can <a href="https://luevano.xyz/contact.html">contact me</a>.</p>]]></content:encoded>
+</figure>]]></content:encoded>
</item>
<item>
<title>Create a website with Nginx and Certbot</title>
<link>https://blog.luevano.xyz/a/website_with_nginx.html</link>
<guid isPermaLink="true">https://blog.luevano.xyz/a/website_with_nginx.html</guid>
<pubDate>Fri, 19 Mar 2021 02:58:15 GMT</pubDate>
+ <category>Code</category>
<category>English</category>
<category>Server</category>
<category>Tools</category>
<category>Tutorial</category>
<description>How to create website that runs on Nginx and uses Certbot for SSL certificates. This is a base for future blog posts about similar topics.</description>
<content:encoded><![CDATA[<p>These are general notes on how to setup a Nginx web server plus Certbot for SSL certificates, initially learned from <a href="https://www.youtube.com/watch?v=OWAqilIVNgE">Luke&rsquo;s video</a> and after some use and research I added more stuff to the mix. And, actually at the time of writing this entry, I&rsquo;m configuring the web server again on a new VPS instance, so this is going to be fresh.</p>
-<p>As a side note, (((i use arch btw))) so everything here es aimed at an Arch Linux distro, and I&rsquo;m doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.</p>
-<h3 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h3>
+<p>As a side note, <mark>i use arch btw</mark> so everything here es aimed at an Arch Linux distro, and I&rsquo;m doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.</p>
+<h2 id="table-of-contents">Table of contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h2>
+<div class="toc">
+<ul>
+<li><a href="#table-of-contents">Table of contents</a></li>
+<li><a href="#prerequisites">Prerequisites</a></li>
+<li><a href="#nginx">Nginx</a></li>
+<li><a href="#certbot">Certbot</a></li>
+</ul>
+</div>
+<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">&para;</a></h2>
<p>You will need two things:</p>
<ul>
<li>A domain name (duh!). I got mine on <a href="https://www.epik.com/?affid=da5ne9ru4">Epik</a> (affiliate link, btw).<ul>
-<li>With the corresponding <strong>A</strong> and <strong>AAA</strong> records pointing to the VPS&rsquo; IPs (&ldquo;A&rdquo; record points to the ipv4 address and &ldquo;AAA&rdquo; to the ipv6, basically). I have three records for each type: empty one, &ldquo;www&rdquo; and &ldquo;*&rdquo; for a wildcard, that way &ldquo;domain.name&rdquo;, &ldquo;www.domain.name&rdquo;, &ldquo;anythingelse.domain.name&rdquo; point to the same VPS (meaning that you can have several VPS for different sub-domains).</li>
+<li>With the corresponding <strong>A</strong> and <strong>AAA</strong> records pointing to the VPS&rsquo; IPs. I have three records for each type: empty string, &ldquo;www&rdquo; and &ldquo;*&rdquo; for a wildcard, that way &ldquo;domain.name&rdquo;, &ldquo;www.domain.name&rdquo;, &ldquo;anythingelse.domain.name&rdquo; point to the same VPS (meaning that you can have several VPS for different sub-domains). These depend on the VPS provider.</li>
</ul>
</li>
-<li>A VPS or somewhere else to host it. I&rsquo;m using <a href="https://www.vultr.com/?ref=8732849">Vultr</a> (also an affiliate link).<ul>
+<li>A VPS or somewhere else to host it. I&rsquo;m using <a href="https://www.vultr.com/?ref=8732849">Vultr</a> (also an affiliate link, btw).<ul>
<li>With <code>ssh</code> already configured both on the local machine and on the remote machine.</li>
-<li>Firewall already configured to allow ports 80 (HTTP) and 443 (HTTPS). I use <code>ufw</code> so it&rsquo;s just a matter of doing <code>ufw allow 80,443/tcp</code> as root and you&rsquo;re golden.</li>
-<li><code>cron</code> installed if you follow along (you could use <code>systemd</code> timers, or some other method you prefer to automate running commands every X time).</li>
+<li>Firewall already configured to allow ports <code>80</code> (HTTP) and <code>443</code> (HTTPS). I use <code>ufw</code> so it&rsquo;s just a matter of doing <code>ufw allow 80,443/tcp</code> (for example) as root and you&rsquo;re golden.</li>
+<li><code>cron</code> installed if you follow along (you could use <code>systemd</code> timers, or some other method you prefer to automate running commands every certain time).</li>
</ul>
</li>
</ul>
-<h3 id="nginx">Nginx<a class="headerlink" href="#nginx" title="Permanent link">&para;</a></h3>
+<h2 id="nginx">Nginx<a class="headerlink" href="#nginx" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Nginx">Nginx</a> is a web (HTTP) server and reverse proxy server.</p>
<p>You have two options: <code>nginx</code> and <code>nginx-mainline</code>. I prefer <code>nginx-mainline</code> because it&rsquo;s the &ldquo;up to date&rdquo; package even though <code>nginx</code> is labeled to be the &ldquo;stable&rdquo; version. Install the package and enable/start the service:</p>
<pre><code class="language-sh">pacman -S nginx-mainline
@@ -2838,7 +2998,7 @@ systemctl start nginx.service
</code></pre>
<p>And that&rsquo;s it, at this point you can already look at the default initial page of Nginx if you enter the IP of your server in a web browser. You should see something like this:</p>
<figure id="__yafg-figure-1">
-<img alt="Nginx welcome page" src="images/b/notes/nginx/nginx_welcome_page.png" title="Nginx welcome page">
+<img alt="Nginx welcome page" src="https://static.luevano.xyz/images/b/notes/nginx/nginx_welcome_page.png" title="Nginx welcome page">
<figcaption>Nginx welcome page</figcaption>
</figure>
<p>As stated in the welcome page, configuration is needed, head to the directory of Nginx:</p>
@@ -2905,7 +3065,7 @@ systemctl restart nginx
</code></pre>
<p>If everything goes correctly, you can now go to your website by typing <code>domain.name</code> on a web browser. But you will see a &ldquo;404 Not Found&rdquo; page like the following (maybe with different Nginx version):</p>
<figure id="__yafg-figure-2">
-<img alt="Nginx 404 Not Found page" src="images/b/notes/nginx/nginx_404_page.png" title="Nginx 404 Not Found page">
+<img alt="Nginx 404 Not Found page" src="https://static.luevano.xyz/images/b/notes/nginx/nginx_404_page.png" title="Nginx 404 Not Found page">
<figcaption>Nginx 404 Not Found page</figcaption>
</figure>
<p>That&rsquo;s no problem, because it means that the web server it&rsquo;s actually working. Just add an <code>index.html</code> file with something simple to see it in action (in the <code>/var/www/some_folder</code> that you decided upon). If you keep seeing the 404 page make sure your <code>root</code> line is correct and that the directory/index file exists.</p>
@@ -2918,7 +3078,7 @@ systemctl restart nginx
try_files $uri/index.html $uri.html $uri/ $uri =404;
...
</code></pre>
-<h3 id="certbot">Certbot<a class="headerlink" href="#certbot" title="Permanent link">&para;</a></h3>
+<h2 id="certbot">Certbot<a class="headerlink" href="#certbot" title="Permanent link">&para;</a></h2>
<p><a href="https://wiki.archlinux.org/title/Certbot">Certbot</a> is what provides the SSL certificates via <a href="https://letsencrypt.org/">Let&rsquo;s Encrypt</a>.</p>
<p>The only &ldquo;bad&rdquo; (bloated) thing about Certbot, is that it uses <code>python</code>, but for me it doesn&rsquo;t matter too much. You may want to look up another alternative if you prefer. Install the packages <code>certbot</code> and <code>certbot-nginx</code>:</p>
<pre><code class="language-sh">pacman -S certbot certbot-nginx
@@ -2930,7 +3090,7 @@ systemctl restart nginx
<p>Now, the certificate given by <code>certbot</code> expires every 3 months or something like that, so you want to renew this certificate every once in a while. Using <code>cron</code>, you can do this by running:</p>
<pre><code class="language-sh">crontab -e
</code></pre>
-<p>And a file will be opened where you need to add a new rule for Certbot, just append the line: <code>1 1 1 * * certbot renew</code> (renew on the first day of every month) and you&rsquo;re good. Alternatively use <code>systemd</code> timers as stated in the <a href="https://wiki.archlinux.org/title/Certbot#Automatic_renewal">Arch Linux Wiki</a>.</p>
+<p>And a file will be opened where you need to add a new rule for Certbot, just append the line: <code>1 1 1 * * certbot renew --quiet --agree-tos --deploy-hook "systemctl reload nginx.service"</code> (renew on the first day of every month) and you&rsquo;re good. Alternatively use <code>systemd</code> timers as stated in the <a href="https://wiki.archlinux.org/title/Certbot#Automatic_renewal">Arch Linux Wiki</a>.</p>
<p>That&rsquo;s it, you now have a website with SSL certificate.</p>]]></content:encoded>
</item>
<item>
@@ -2945,8 +3105,10 @@ systemctl restart nginx
<description>Actualización en el estado del blog y el sistema usado para crearlo.</description>
<content:encoded><![CDATA[<p>Pues eso, esta entrada es sólo para tirar update sobre mi <a href="https://blog.luevano.xyz/a/first_blog_post.html">primer post</a>. Ya modifiqué el <code>ssg</code> lo suficiente como para que maneje los <em>timestamps</em>, y ya estoy más familiarizado con este script entonces ya lo podré extender más, pero por ahora las entradas ya tienen su fecha de creación (y modificación en dado caso) al final y en el índice ya están organizados por fecha, que por ahora está algo simple pero está sencillo de extender.</p>
<p>Ya lo único que queda es cambiar un poco el formato del blog (y de la página en general), porque en un momento de desesperación puse todo el texto en justificado y pues no se ve chido siempre, entonces queda corregir eso. <em>Y aunque me tomó más tiempo del que quisiera, así nomás quedó, diría un cierto personaje.</em></p>
-<p>El <code>ssg</code> modificado está en mis <a href="https://git.luevano.xyz/.dots">dotfiles</a> (o directamente <a href="https://git.luevano.xyz/.dots/tree/.local/bin/ssg">aquí</a>).</p>
-<p>Por último, también quité las extensiones <code>.html</code> de las URLs, porque se veía bien pitero, pero igual los links con <code>.html</code> al final redirigen a su link sin <code>.html</code>, así que no hay rollo alguno.</p>]]></content:encoded>
+<p><del>El <code>ssg</code> modificado está en mis <a href="https://git.luevano.xyz/.dots">dotfiles</a> (o directamente <a href="https://git.luevano.xyz/.dots/tree/.local/bin/ssg">aquí</a>).</del>
+<ins>Como al final ya no usé el <code>ssg</code> modificado, este pex ya no existe.</ins></p>
+<p>Por último, también quité las extensiones <code>.html</code> de las URLs, porque se ve bien pitero, pero igual los links con <code>.html</code> al final redirigen a su link sin <code>.html</code>, así que no hay rollo alguno.</p>
+<p><strong>Actualización</strong>: Ahora estoy usando mi propia solución en vez de <code>ssg</code>, que la llamé <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, de la cual empiezo a hablar <a href="https://blog.luevano.xyz/a/new_blogging_system.html">acá</a>.</p>]]></content:encoded>
</item>
<item>
<title>This is the first blog post, just for testing purposes</title>
@@ -2958,9 +3120,10 @@ systemctl restart nginx
<category>Tools</category>
<category>Update</category>
<description>Just my first blog post where I state what tools I'm using to build this blog.</description>
- <content:encoded><![CDATA[<p>I&rsquo;m making this post just to figure out how <a href="https://www.romanzolotarev.com/ssg.html"><code>ssg5</code></a> and <a href="https://kristaps.bsd.lv/lowdown/"><code>lowdown</code></a> are supposed to work (and eventually also <a href="https://www.romanzolotarev.com/rssg.html"><code>rssg</code></a>).</p>
-<p>At the moment, I&rsquo;m not satisfied because there&rsquo;s no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the <a href="https://blog.luevano.xyz/">blog homepage</a> (and there&rsquo;s also the problem with the ordering of the entries&hellip;). And all of this just because I didn&rsquo;t want to use <a href="https://github.com/LukeSmithxyz/lb">Luke&rsquo;s</a> solution (don&rsquo;t really like that much how he handles the scripts&hellip; <em>but they just work</em>).</p>
-<p>Hopefully, for tomorrow all of this will be sorted out and I&rsquo;ll have a working blog system.</p>]]></content:encoded>
+ <content:encoded><![CDATA[<p>I&rsquo;m making this post just to figure out how <a href="https://www.romanzolotarev.com/ssg.html"><code>ssg5</code></a> and <a href="https://kristaps.bsd.lv/lowdown/"><code>lowdown</code></a> are supposed to work, and eventually <a href="https://www.romanzolotarev.com/rssg.html"><code>rssg</code></a>.</p>
+<p>At the moment I&rsquo;m not satisfied because there&rsquo;s no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the <a href="https://blog.luevano.xyz/">blog homepage</a> which also has a problem with the ordering of the entries. And all of this just because I didn&rsquo;t want to use Luke&rsquo;s <a href="https://github.com/LukeSmithxyz/lb">lb</a> solution as I don&rsquo;t really like that much how he handles the scripts (<em>but they just work</em>).</p>
+<p>Hopefully, for tomorrow all of this will be sorted out and I&rsquo;ll have a working blog system.</p>
+<p><strong>Update</strong>: I&rsquo;m now using my own solution which I called <a href="https://github.com/luevano/pyssg"><code>pyssg</code></a>, of which I talk about <a href="https://blog.luevano.xyz/a/new_blogging_system.html">here</a>.</p>]]></content:encoded>
</item>
</channel>
</rss> \ No newline at end of file
diff --git a/live/blog/sitemap.xml b/live/blog/sitemap.xml
index 6b40c4b..caceb5e 100644
--- a/live/blog/sitemap.xml
+++ b/live/blog/sitemap.xml
@@ -47,37 +47,37 @@
<url>
<loc>https://blog.luevano.xyz/a/rewrote_pyssg_again.html</loc>
- <lastmod>2022-12-20</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/g/gogodot_jam3_devlog_1.html</loc>
- <lastmod>2022-06-10</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html</loc>
- <lastmod>2022-05-29</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/g/godot_project_structure.html</loc>
- <lastmod>2022-05-24</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/g/starting_gamedev_blogging.html</loc>
- <lastmod>2022-05-22</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/password_manager_authenticator_setup.html</loc>
- <lastmod>2022-05-22</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
@@ -89,13 +89,13 @@
</url>
<url>
<loc>https://blog.luevano.xyz/a/volviendo_a_usar_la_pagina.html</loc>
- <lastmod>2022-04-28</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/vpn_server_with_openvpn.html</loc>
- <lastmod>2021-08-01</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
@@ -107,66 +107,72 @@
</url>
<url>
<loc>https://blog.luevano.xyz/a/tenia_esto_descuidado.html</loc>
- <lastmod>2021-07-18</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/xmpp_server_with_prosody.html</loc>
- <lastmod>2022-12-20</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/acomodada_la_pagina_de_arte.html</loc>
- <lastmod>2021-06-06</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/asi_nomas_esta_quedando.html</loc>
- <lastmod>2021-06-04</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/new_blogging_system.html</loc>
- <lastmod>2021-05-28</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/git_server_with_cgit.html</loc>
- <lastmod>2021-06-08</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/mail_server_with_postfix.html</loc>
- <lastmod>2021-06-08</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/website_with_nginx.html</loc>
- <lastmod>2021-06-08</lastmod>
+ <lastmod>2023-05-05</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/el_blog_ya_tiene_timestamps.html</loc>
- <lastmod>2021-05-17</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://blog.luevano.xyz/a/first_blog_post.html</loc>
- <lastmod>2021-05-17</lastmod>
+ <lastmod>2023-05-04</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
+ <loc>https://blog.luevano.xyz/tag/@code.html</loc>
+ <lastmod></lastmod>
+ <changefreq>daily</changefreq>
+ <priority>0.5</priority>
+ </url>
+ <url>
<loc>https://blog.luevano.xyz/tag/@english.html</loc>
<lastmod></lastmod>
<changefreq>daily</changefreq>
@@ -185,6 +191,12 @@
<priority>0.5</priority>
</url>
<url>
+ <loc>https://blog.luevano.xyz/tag/@gdscript.html</loc>
+ <lastmod></lastmod>
+ <changefreq>daily</changefreq>
+ <priority>0.5</priority>
+ </url>
+ <url>
<loc>https://blog.luevano.xyz/tag/@godot.html</loc>
<lastmod></lastmod>
<changefreq>daily</changefreq>
diff --git a/live/blog/tag/@code.html b/live/blog/tag/@code.html
new file mode 100644
index 0000000..caab191
--- /dev/null
+++ b/live/blog/tag/@code.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<html class="theme-dark" lang="en
+"
+ prefix="og: https://ogp.me/ns#">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="icon" href="https://static.luevano.xyz/images/icons/favicon.ico">
+<title>Posts filtered by code -- Luevano's Blog</title>
+<meta name="description" content="Posts filtered by code"/>
+<link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luevano's Blog RSS">
+ <!-- general style -->
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/style.css">
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/fork-awesome/css/fork-awesome.min.css">
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/font-awesome/css/all.min.css">
+ <!-- theme related -->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
+ <link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
+ <!-- extra -->
+ <!-- og meta -->
+ <meta property="og:title" content="Luevano's Blog"/>
+ <meta property="og:type" content="article"/>
+ <meta property="og:url" content="https://blog.luevano.xyz/tag/@code.html"/>
+ <meta property="og:image" content="https://static.luevano.xyz/images/b/default.png"/>
+ <meta property="og:description" content="Posts filtered by code"/>
+ <meta property="og:locale" content="en"/>
+ <meta property="og:site_name" content="Luevano's Blog"/>
+ </head>
+
+ <body>
+ <header>
+<nav>
+ <ul>
+ <li>
+ <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a>
+ </li>
+
+ <li>
+ <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a>
+ </li>
+
+ <li>
+ <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a>
+ </li>
+
+ <li><i class="fab fa-git" alt="Git"></i><span>Git</span>
+ <ul>
+ <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li>
+
+ <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li>
+
+ <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li>
+ </ul>
+ </li>
+
+ <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span>
+ <ul>
+ <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li>
+ </ul>
+ </li>
+ </ul>
+</nav>
+
+<button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button>
+
+ </header>
+
+ <main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
+ <h1>Posts filtered by code</h1>
+
+ <h2>Articles</h2>
+ <ul class="page-list">
+ <h3>August 2021</h3>
+ <li>Aug 01 - <a href="https://blog.luevano.xyz/a/vpn_server_with_openvpn.html">Create a VPN server with OpenVPN (IPv4)</a></li>
+ <h3>June 2021</h3>
+ <li>Jun 09 - <a href="https://blog.luevano.xyz/a/xmpp_server_with_prosody.html">Create an XMPP server with Prosody compatible with Conversations and Movim</a></li>
+ <h3>March 2021</h3>
+ <li>Mar 21 - <a href="https://blog.luevano.xyz/a/git_server_with_cgit.html">Create a git server and setup cgit web app (on Nginx)</a></li>
+ <li>Mar 21 - <a href="https://blog.luevano.xyz/a/mail_server_with_postfix.html">Create a mail server with Postfix, Dovecot, SpamAssassin and OpenDKIM</a></li>
+ <li>Mar 19 - <a href="https://blog.luevano.xyz/a/website_with_nginx.html">Create a website with Nginx and Certbot</a></li>
+ </ul>
+
+
+ </main>
+
+ <footer>
+<span>
+ <i class="fas fa-address-card" alt="Contact"></i>
+ <a href="https://blog.luevano.xyz/contact.html">Contact</a>
+</span>
+
+<span>
+ <i class="fas fa-donate" alt="Donate"></i>
+ <a href="https://blog.luevano.xyz/donate.html">Donate</a>
+</span>
+
+<span>
+ <i class="fas fa-rss" alt="RSS"></i>
+ <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a>
+</span>
+
+<br>
+<span class="created-with">
+ <i class="fas fa-hammer" alt="Hammer"></i>
+ Created with <a href="https://github.com/luevano/pyssg">pyssg</a>
+</span>
+
+<br>
+<span class="copyright">
+ Copyright <i class="far fa-copyright" alt="Copyright"></i> 2023 David Luévano Alvarado
+</span>
+
+ </footer>
+ </body>
+</html> \ No newline at end of file
diff --git a/live/blog/tag/@english.html b/live/blog/tag/@english.html
index 11b0866..b4cd9c1 100644
--- a/live/blog/tag/@english.html
+++ b/live/blog/tag/@english.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by english</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@gamedev.html b/live/blog/tag/@gamedev.html
index 84a30b1..ba38db5 100644
--- a/live/blog/tag/@gamedev.html
+++ b/live/blog/tag/@gamedev.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by gamedev</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@gamejam.html b/live/blog/tag/@gamejam.html
index 2dac914..910b781 100644
--- a/live/blog/tag/@gamejam.html
+++ b/live/blog/tag/@gamejam.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by gamejam</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@gdscript.html b/live/blog/tag/@gdscript.html
new file mode 100644
index 0000000..dcc53d0
--- /dev/null
+++ b/live/blog/tag/@gdscript.html
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html class="theme-dark" lang="en
+"
+ prefix="og: https://ogp.me/ns#">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="icon" href="https://static.luevano.xyz/images/icons/favicon.ico">
+<title>Posts filtered by gdscript -- Luevano's Blog</title>
+<meta name="description" content="Posts filtered by gdscript"/>
+<link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luevano's Blog RSS">
+ <!-- general style -->
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/style.css">
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/fork-awesome/css/fork-awesome.min.css">
+ <link rel="stylesheet" type="text/css" href="https://static.luevano.xyz/font-awesome/css/all.min.css">
+ <!-- theme related -->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
+ <link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
+ <!-- extra -->
+ <!-- og meta -->
+ <meta property="og:title" content="Luevano's Blog"/>
+ <meta property="og:type" content="article"/>
+ <meta property="og:url" content="https://blog.luevano.xyz/tag/@gdscript.html"/>
+ <meta property="og:image" content="https://static.luevano.xyz/images/b/default.png"/>
+ <meta property="og:description" content="Posts filtered by gdscript"/>
+ <meta property="og:locale" content="en"/>
+ <meta property="og:site_name" content="Luevano's Blog"/>
+ </head>
+
+ <body>
+ <header>
+<nav>
+ <ul>
+ <li>
+ <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a>
+ </li>
+
+ <li>
+ <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a>
+ </li>
+
+ <li>
+ <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a>
+ </li>
+
+ <li><i class="fab fa-git" alt="Git"></i><span>Git</span>
+ <ul>
+ <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li>
+
+ <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li>
+
+ <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li>
+ </ul>
+ </li>
+
+ <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span>
+ <ul>
+ <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li>
+ </ul>
+ </li>
+ </ul>
+</nav>
+
+<button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button>
+
+ </header>
+
+ <main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
+ <h1>Posts filtered by gdscript</h1>
+
+ <h2>Articles</h2>
+ <ul class="page-list">
+ <h3>June 2022</h3>
+ <li>Jun 10 - <a href="https://blog.luevano.xyz/g/gogodot_jam3_devlog_1.html">Creating my Go Godot Jam 3 entry using Godot 3.5 devlog 1</a></li>
+ <h3>May 2022</h3>
+ <li>May 29 - <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">Creating a FlappyBird clone in Godot 3.5 devlog 1</a></li>
+ </ul>
+
+
+ </main>
+
+ <footer>
+<span>
+ <i class="fas fa-address-card" alt="Contact"></i>
+ <a href="https://blog.luevano.xyz/contact.html">Contact</a>
+</span>
+
+<span>
+ <i class="fas fa-donate" alt="Donate"></i>
+ <a href="https://blog.luevano.xyz/donate.html">Donate</a>
+</span>
+
+<span>
+ <i class="fas fa-rss" alt="RSS"></i>
+ <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a>
+</span>
+
+<br>
+<span class="created-with">
+ <i class="fas fa-hammer" alt="Hammer"></i>
+ Created with <a href="https://github.com/luevano/pyssg">pyssg</a>
+</span>
+
+<br>
+<span class="copyright">
+ Copyright <i class="far fa-copyright" alt="Copyright"></i> 2023 David Luévano Alvarado
+</span>
+
+ </footer>
+ </body>
+</html> \ No newline at end of file
diff --git a/live/blog/tag/@godot.html b/live/blog/tag/@godot.html
index 8ebf464..3f7a243 100644
--- a/live/blog/tag/@godot.html
+++ b/live/blog/tag/@godot.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by godot</h1>
<h2>Articles</h2>
@@ -74,6 +81,8 @@
<li>Jun 10 - <a href="https://blog.luevano.xyz/g/gogodot_jam3_devlog_1.html">Creating my Go Godot Jam 3 entry using Godot 3.5 devlog 1</a></li>
<h3>May 2022</h3>
<li>May 29 - <a href="https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html">Creating a FlappyBird clone in Godot 3.5 devlog 1</a></li>
+ <li>May 22 - <a href="https://blog.luevano.xyz/g/godot_project_structure.html">General Godot project structure</a></li>
+ <li>May 17 - <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html">Will start blogging about gamedev</a></li>
</ul>
diff --git a/live/blog/tag/@rant.html b/live/blog/tag/@rant.html
index 0d117f3..186d395 100644
--- a/live/blog/tag/@rant.html
+++ b/live/blog/tag/@rant.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by rant</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@server.html b/live/blog/tag/@server.html
index aaf9f8f..3aa9f4c 100644
--- a/live/blog/tag/@server.html
+++ b/live/blog/tag/@server.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by server</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@short.html b/live/blog/tag/@short.html
index 888b0cb..2838cc1 100644
--- a/live/blog/tag/@short.html
+++ b/live/blog/tag/@short.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by short</h1>
<h2>Articles</h2>
@@ -79,7 +86,7 @@
<h3>April 2022</h3>
<li>Apr 28 - <a href="https://blog.luevano.xyz/a/volviendo_a_usar_la_pagina.html">Volviendo a usar la página</a></li>
<h3>July 2021</h3>
- <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenia este pex algo descuidado</a></li>
+ <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenía este pex algo descuidado</a></li>
<h3>June 2021</h3>
<li>Jun 06 - <a href="https://blog.luevano.xyz/a/acomodada_la_pagina_de_arte.html">Al fin ya me acomodé la página pa' los dibujos</a></li>
<li>Jun 04 - <a href="https://blog.luevano.xyz/a/asi_nomas_esta_quedando.html">Así nomás está quedando el página</a></li>
diff --git a/live/blog/tag/@spanish.html b/live/blog/tag/@spanish.html
index 534dc1f..b77333e 100644
--- a/live/blog/tag/@spanish.html
+++ b/live/blog/tag/@spanish.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by spanish</h1>
<h2>Articles</h2>
@@ -76,7 +83,7 @@
<li>Apr 28 - <a href="https://blog.luevano.xyz/a/volviendo_a_usar_la_pagina.html">Volviendo a usar la página</a></li>
<h3>July 2021</h3>
<li>Jul 28 - <a href="https://blog.luevano.xyz/a/hoy_toco_desarrollo_personaje.html">Hoy me tocó desarrollo de personaje</a></li>
- <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenia este pex algo descuidado</a></li>
+ <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenía este pex algo descuidado</a></li>
<h3>June 2021</h3>
<li>Jun 06 - <a href="https://blog.luevano.xyz/a/acomodada_la_pagina_de_arte.html">Al fin ya me acomodé la página pa' los dibujos</a></li>
<li>Jun 04 - <a href="https://blog.luevano.xyz/a/asi_nomas_esta_quedando.html">Así nomás está quedando el página</a></li>
diff --git a/live/blog/tag/@tools.html b/live/blog/tag/@tools.html
index ce1a9e3..ec2e758 100644
--- a/live/blog/tag/@tools.html
+++ b/live/blog/tag/@tools.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by tools</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@tutorial.html b/live/blog/tag/@tutorial.html
index 0d55bff..8f28716 100644
--- a/live/blog/tag/@tutorial.html
+++ b/live/blog/tag/@tutorial.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by tutorial</h1>
<h2>Articles</h2>
diff --git a/live/blog/tag/@update.html b/live/blog/tag/@update.html
index 0cf313c..370cf8d 100644
--- a/live/blog/tag/@update.html
+++ b/live/blog/tag/@update.html
@@ -16,6 +16,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Blog"/>
@@ -66,6 +68,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Posts filtered by update</h1>
<h2>Articles</h2>
@@ -78,7 +85,7 @@
<h3>April 2022</h3>
<li>Apr 28 - <a href="https://blog.luevano.xyz/a/volviendo_a_usar_la_pagina.html">Volviendo a usar la página</a></li>
<h3>July 2021</h3>
- <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenia este pex algo descuidado</a></li>
+ <li>Jul 18 - <a href="https://blog.luevano.xyz/a/tenia_esto_descuidado.html">Tenía este pex algo descuidado</a></li>
<h3>June 2021</h3>
<li>Jun 06 - <a href="https://blog.luevano.xyz/a/acomodada_la_pagina_de_arte.html">Al fin ya me acomodé la página pa' los dibujos</a></li>
<li>Jun 04 - <a href="https://blog.luevano.xyz/a/asi_nomas_esta_quedando.html">Así nomás está quedando el página</a></li>
diff --git a/live/luevano.xyz/404.html b/live/luevano.xyz/404.html
index 76f5020..13b0b08 100644
--- a/live/luevano.xyz/404.html
+++ b/live/luevano.xyz/404.html
@@ -17,6 +17,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Site"/>
@@ -67,6 +69,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>404 Not found</h1>
<figure id="__yafg-figure-1">
diff --git a/live/luevano.xyz/contact.html b/live/luevano.xyz/contact.html
index 584c943..6efbfe6 100644
--- a/live/luevano.xyz/contact.html
+++ b/live/luevano.xyz/contact.html
@@ -17,6 +17,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Site"/>
@@ -67,6 +69,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Contact</h1>
<p><img class="wrap-right" src="images/gifs/head_talking_1_trans.gif" width="100px" alt="Contact info"></p>
diff --git a/live/luevano.xyz/donate.html b/live/luevano.xyz/donate.html
index df6971d..885c585 100644
--- a/live/luevano.xyz/donate.html
+++ b/live/luevano.xyz/donate.html
@@ -17,6 +17,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Site"/>
@@ -67,6 +69,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Donate</h1>
<p><img class="wrap-right" src="images/gifs/dollar_sign_spin_1.gif" alt="Donate"></p>
diff --git a/live/luevano.xyz/index.html b/live/luevano.xyz/index.html
index 092238b..19f6909 100644
--- a/live/luevano.xyz/index.html
+++ b/live/luevano.xyz/index.html
@@ -17,6 +17,8 @@
<!-- theme related -->
<script type="text/javascript" src="https://static.luevano.xyz/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="https://static.luevano.xyz/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="https://static.luevano.xyz/scripts/return_top.js"></script>
<!-- extra -->
<!-- og meta -->
<meta property="og:title" content="Luevano's Site"/>
@@ -67,6 +69,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
<h1>Luévano's Site</h1>
<h3 id="welcome">Welcome!<a class="headerlink" href="#welcome" title="Permanent link">&para;</a></h3>
diff --git a/live/static/css/style.css b/live/static/css/style.css
index 5a18881..161da3d 100644
--- a/live/static/css/style.css
+++ b/live/static/css/style.css
@@ -13,6 +13,46 @@ h2 {
text-align: center;
}
+h1 a.headerlink,
+h2 a.headerlink,
+h3 a.headerlink,
+h4 a.headerlink,
+h5 a.headerlink,
+h5 a.headerlink {
+ display: none;
+ padding-left: 0.3em;
+}
+
+h1:hover a.headerlink,
+h2:hover a.headerlink,
+h3:hover a.headerlink,
+h4:hover a.headerlink,
+h5:hover a.headerlink,
+h6:hover a.headerlink{
+ display: inline;
+}
+
+div.return-top {
+ position: fixed;
+ bottom: 1em;
+ right: 1em;
+}
+
+button.return-top {
+ display: none;
+ border: none;
+ font: inherit;
+ cursor: pointer;
+ position: relative;
+ border-radius: 5px;
+ min-width: 1em;
+ padding-top: 0.2em;
+ padding-bottom: 0.2em;
+ padding-left: 0.4em;
+ padding-right: 0.4em;
+}
+
+
body,
html {
margin: 0;
@@ -77,6 +117,12 @@ main.art p {
width: clamp(30ch, calc(100% - 1em), 75ch);
}
+/* TOC */
+
+div.toc {
+ border-radius: 5px;
+ overflow-wrap: anywhere;
+}
/* article/art elements */
div.article-info,
@@ -243,7 +289,6 @@ img {
display: block;
margin-left: auto;
margin-right: auto;
- vertical-align: middle;
}
img.wrap-right {
@@ -377,7 +422,9 @@ div.page-nav > span {
padding-left: 0.4em;
padding-right: 0.4em;
margin-left: 0.2em;
- margin-right: 0.2em;
+ margin-right: 0.2em
+
+ ;
}
div.art-nav > span span,
diff --git a/live/static/css/theme.css b/live/static/css/theme.css
index c9b85c6..80ae808 100644
--- a/live/static/css/theme.css
+++ b/live/static/css/theme.css
@@ -46,7 +46,7 @@
--code-border: var(--color3);
--art-border: var(--color3);
- --pagenav-bg: var(--color1);
+ --pagenav-bg: var(--color5);
--pagenav-bg-hl: var(--color2);
--pagenav-link: var(--color8);
--pagenav-link-hl: var(--color7);
@@ -80,7 +80,7 @@
--code-border: var(--color4);
--art-border: var(--color4);
- --pagenav-bg: var(--color10);
+ --pagenav-bg: var(--color3);
--pagenav-bg-hl: var(--color9);
--pagenav-link: var(--color7);
--pagenav-link-hl: var(--color6);
@@ -137,6 +137,24 @@ h5 {
color: var(--fg-acc5);
}
+a.headerlink {
+ color: var(--fg-acc2);
+}
+
+a.headerlink:hover {
+ color: var(--fg-acc1);
+}
+
+button.return-top {
+ background-color: var(--navitem-bg);
+ color: var(--navitem-link);
+}
+
+button.return-top:hover {
+ background-color: var(--navitem-bg-hl);
+ color: var(--navitem-link-hl);
+}
+
body {
background: var(--bg);
color: var(--fg);
@@ -151,6 +169,21 @@ pre, code {
border: 1px solid var(--code-border);
}
+/* TOC */
+
+div.toc {
+ border: 1px solid var(--code-border);
+ background-color: var(--bg);
+}
+
+div.toc a {
+ color: var(--fg-acc2)
+}
+
+div.toc a:hover {
+ color: var(--fg-acc1)
+}
+
/* nav bar */
body > header {
background: var(--bg);
diff --git a/live/static/scripts/return_top.js b/live/static/scripts/return_top.js
new file mode 100644
index 0000000..77c468f
--- /dev/null
+++ b/live/static/scripts/return_top.js
@@ -0,0 +1,21 @@
+// Taken from https://www.w3schools.com/howto/howto_js_scroll_to_top.asp
+// and tweaked as needed
+document.addEventListener("DOMContentLoaded", function(event) {
+ let returnTopButton = document.getElementById("returnTopButton");
+ let scrollTopAppearPX = window.screen.availHeight;
+
+ window.onscroll = function() {scrolling(returnTopButton, scrollTopAppearPX)};
+})
+
+function scrolling(returnButton, onScrollAppear) {
+ if (document.body.scrollTop > onScrollAppear || document.documentElement.scrollTop > onScrollAppear) {
+ returnButton.style.display = "inline-block";
+ } else {
+ returnButton.style.display = "none";
+ }
+}
+
+function returnTop() {
+ document.body.scrollTop = 0; // For Safari
+ document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
+}
diff --git a/plt/base.html b/plt/base.html
index 5548ec9..1f476dc 100644
--- a/plt/base.html
+++ b/plt/base.html
@@ -15,6 +15,8 @@
<!-- theme related -->
<script type="text/javascript" src="{{config['url']['static']}}/scripts/theme.js"></script>
<link id="theme-css" rel="stylesheet" type="text/css" href="{{config['url']['static']}}/css/theme.css">
+ <!-- misc functions-->
+ <script type="text/javascript" src="{{config['url']['static']}}/scripts/return_top.js"></script>
<!-- extra -->
{%block head_extra%}{%endblock head_extra%}
<!-- og meta -->
@@ -27,6 +29,11 @@
</header>
<main>
+ <div class="return-top">
+ <button class="return-top" onclick="returnTop()" id="returnTopButton">
+ <i class="fas fa-arrow-up" alt="Return to top"></i>
+ </button>
+ </div>
{%block body_content%}{%endblock body_content%}
</main>
diff --git a/plt/blog/page.html b/plt/blog/page.html
index 40a98e2..f54e28c 100644
--- a/plt/blog/page.html
+++ b/plt/blog/page.html
@@ -21,14 +21,18 @@
{%endblock head_rss%}
{%block head_extra%}
-{%import "highlightjs.html" as hljs%}
-{{hljs.print(config)}}
-{%endblock head_extra%}
+{%for t in page.tags%}
+ {%if t[0] == "code" or t[0] == "gdscript" %}
+ {%import "highlightjs.html" as hljs%}
+ {{hljs.print(config)}}
+ {%endif%}
-{%block gdscript_hl%}
-<!-- Specific to GDScript -->
-<script type="text/javascript" src="{{config['url']['static']}}/hl/languages/gdscript.min.js"></script>
-{%endblock gdscript_hl%}
+ {%if t[0] == "gdscript" %}
+ <!-- Specific to GDScript -->
+ <script type="text/javascript" src="{{config['url']['static']}}/hl/languages/gdscript.min.js"></script>
+ {%endif%}
+{%endfor%}
+{%endblock head_extra%}
{%block head_og%}
<meta property="og:title" content="{{page.title}} -- {{config['title']}}"/>
diff --git a/plt/highlightjs.html b/plt/highlightjs.html
index d44f3e8..9a19a27 100644
--- a/plt/highlightjs.html
+++ b/plt/highlightjs.html
@@ -1,7 +1,6 @@
{%macro print(config)%}
<!-- highlight support for code blocks -->
<script type="text/javascript" src="{{config['url']['static']}}/hl/highlight.min.js"></script>
-{%block gdscript_hl%}{%endblock gdscript_hl%}
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
diff --git a/src/art/a/hand_sketches.md b/src/art/a/hand_sketches.md
index fb6d02b..e9dec11 100644
--- a/src/art/a/hand_sketches.md
+++ b/src/art/a/hand_sketches.md
@@ -12,6 +12,6 @@ Me dibujé la mano varias veces con un pincel que me encontré de Krita muy buen
Según yo probé "métodos" (y como dos-tres pinceles) diferentes, pero realmente están muy similares en "procedimiento". Igual quedé conforme con el resultado.
-Ahora con el anuncio del ???Elden Ring??? se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.
+Ahora con el anuncio del ==Elden Ring== se antojó hacerse un dibujo relacionado, pero aún no sé qué ni cómo, pero quizá me eche algo así.
Pues ahí mero. Y por cierto que muchas gracias a quien me donó hace unos días por el dibujo pasado, se aprecia mi bro.
diff --git a/src/blog/a/acomodada_la_pagina_de_arte.md b/src/blog/a/acomodada_la_pagina_de_arte.md
index 2cac170..9321efb 100644
--- a/src/blog/a/acomodada_la_pagina_de_arte.md
+++ b/src/blog/a/acomodada_la_pagina_de_arte.md
@@ -8,6 +8,6 @@ tags: short
Así es, ya quedó acomodado el sub-dominio `art.luevano.xyz` pos pal [arte](https://art.luevano.xyz) veda. Entonces pues ando feliz por eso.
-Este pedo fue gracias a que me reescribí la forma en la que `pyssg` maneja los templates, ahora uso el sistema de `jinja` en vez del cochinero que hacía antes.
+Este pedo fue gracias a que me reescribí la forma en la que [`pyssg`](${PYSSG_URL}) maneja los templates, ahora uso el sistema de [`jinja`](https://jinja.palletsprojects.com/en/3.1.x/) en vez del cochinero que hacía antes.
Y pues nada más eso, aquí está el [primer post](https://art.luevano.xyz/a/elephant_octopus.html) y por supuesto acá está el link del RSS [https://art.luevano.xyz/rss.xml](https://art.luevano.xyz/rss.xml).
diff --git a/src/blog/a/asi_nomas_esta_quedando.md b/src/blog/a/asi_nomas_esta_quedando.md
index c1ed74c..6577ca8 100644
--- a/src/blog/a/asi_nomas_esta_quedando.md
+++ b/src/blog/a/asi_nomas_esta_quedando.md
@@ -12,6 +12,8 @@ También me puse a acomodar un servidor de [XMPP](https://xmpp.org/) el cual, en
Ahorita este server es SUMISO (*compliant* en español, jeje) para jalar con la app [conversations](https://conversations.im/) y con la red social [movim](https://movim.eu/), pero realmente funcionaría con casi cualquier cliente de XMPP, amenos que ese cliente implemente algo que no tiene mi server. Y también acomodé un server de [Matrix](https://matrix.org/) que es muy similar pero es bajo otro protocolo y se siente más como un discord/slack (al menos en el [element](https://element.io/)), muy chingón también.
-Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el [pyssg](https://github.com/luevano/pyssg) para que jale chido para este pex.
+Si bien aún quedan cosas por hacer sobre estos dos servers que me acomodé (además de hacerles unas entradas para documentar cómo lo hice), quiero moverme a otra cosa que sería acomodar una sección de dibujos, lo cual en teoría es bien sencillo, pero como quiero poder automatizar la publicación de estos, quiero modificar un poco el [`pyssg`](${PYSSG_URL}) para que jale chido para este pex.
Ya por último también quiero moverle un poco al CSS, porque lo dejé en un estado muy culerón y quiero meterle/ajustar unas cosas para que quede más limpio y medianamente bonito... *dentro de lo que cabe porque evidentemente me vale verga si se ve como una página del 2000*.
+
+**Actualización**: Ya tumbé el servidor de XMPP porque consumía bastantes recursos y no lo usaba tanto, si en un futuro consigo un mejor servidor podría volver a hostearlo. \ No newline at end of file
diff --git a/src/blog/a/el_blog_ya_tiene_timestamps.md b/src/blog/a/el_blog_ya_tiene_timestamps.md
index 4fbe9bd..b011732 100644
--- a/src/blog/a/el_blog_ya_tiene_timestamps.md
+++ b/src/blog/a/el_blog_ya_tiene_timestamps.md
@@ -11,6 +11,9 @@ Pues eso, esta entrada es sólo para tirar update sobre mi [primer post](https:/
Ya lo único que queda es cambiar un poco el formato del blog (y de la página en general), porque en un momento de desesperación puse todo el texto en justificado y pues no se ve chido siempre, entonces queda corregir eso. *Y aunque me tomó más tiempo del que quisiera, así nomás quedó, diría un cierto personaje.*
-El `ssg` modificado está en mis [dotfiles](https://git.luevano.xyz/.dots) (o directamente [aquí](https://git.luevano.xyz/.dots/tree/.local/bin/ssg)).
+~~El `ssg` modificado está en mis [dotfiles](https://git.luevano.xyz/.dots) (o directamente [aquí](https://git.luevano.xyz/.dots/tree/.local/bin/ssg)).~~
+^^Como al final ya no usé el `ssg` modificado, este pex ya no existe.^^
-Por último, también quité las extensiones `.html` de las URLs, porque se veía bien pitero, pero igual los links con `.html` al final redirigen a su link sin `.html`, así que no hay rollo alguno.
+Por último, también quité las extensiones `.html` de las URLs, porque se ve bien pitero, pero igual los links con `.html` al final redirigen a su link sin `.html`, así que no hay rollo alguno.
+
+**Actualización**: Ahora estoy usando mi propia solución en vez de `ssg`, que la llamé [`pyssg`](${PYSSG_URL}), de la cual empiezo a hablar [acá](https://blog.luevano.xyz/a/new_blogging_system.html).
diff --git a/src/blog/a/first_blog_post.md b/src/blog/a/first_blog_post.md
index b4851f2..1cdeb5e 100644
--- a/src/blog/a/first_blog_post.md
+++ b/src/blog/a/first_blog_post.md
@@ -7,8 +7,10 @@ tags: short
tools
english
-I'm making this post just to figure out how [`ssg5`](https://www.romanzolotarev.com/ssg.html) and [`lowdown`](https://kristaps.bsd.lv/lowdown/) are supposed to work (and eventually also [`rssg`](https://www.romanzolotarev.com/rssg.html)).
+I'm making this post just to figure out how [`ssg5`](https://www.romanzolotarev.com/ssg.html) and [`lowdown`](https://kristaps.bsd.lv/lowdown/) are supposed to work, and eventually [`rssg`](https://www.romanzolotarev.com/rssg.html).
-At the moment, I'm not satisfied because there's no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the [blog homepage](https://blog.luevano.xyz/) (and there's also the problem with the ordering of the entries...). And all of this just because I didn't want to use [Luke's](https://github.com/LukeSmithxyz/lb) solution (don't really like that much how he handles the scripts... *but they just work*).
+At the moment I'm not satisfied because there's no automatic date insertion into the 1) html file, 2) the blog post itself and 3) the listing system in the [blog homepage](https://blog.luevano.xyz/) which also has a problem with the ordering of the entries. And all of this just because I didn't want to use Luke's [lb](https://github.com/LukeSmithxyz/lb) solution as I don't really like that much how he handles the scripts (*but they just work*).
Hopefully, for tomorrow all of this will be sorted out and I'll have a working blog system.
+
+**Update**: I'm now using my own solution which I called [`pyssg`](${PYSSG_URL}), of which I talk about [here](https://blog.luevano.xyz/a/new_blogging_system.html).
diff --git a/src/blog/a/git_server_with_cgit.md b/src/blog/a/git_server_with_cgit.md
index 4eb440c..63fae28 100644
--- a/src/blog/a/git_server_with_cgit.md
+++ b/src/blog/a/git_server_with_cgit.md
@@ -4,21 +4,26 @@ lang: en
summary: How to create a git server using cgit on a server running Nginx. This is a follow up on post about creating a website with Nginx and Certbot.
tags: server
tools
+ code
tutorial
english
-My git server is all I need to setup to actually *kill* my other server (I've been moving from servers on these last 2-3 blog entries), that's why I'm already doing this entry. I'm basically following [git's guide on setting up a server](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server) plus some specific stuff for (btw i use) Arch Linux ([Arch Linux Wiki: Git server](https://wiki.archlinux.org/index.php/Git_server#Web_interfaces) and [Step by step guide on setting up git server in arch linux (pushable)](https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/)).
+My git server is all I need to setup to actually *kill* my other server (I've been moving from servers on these last 2-3 blog entries), that's why I'm already doing this entry. I'm basically following [git's guide on setting up a server](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server) plus some specific stuff for ==btw i use== Arch Linux ([Arch Linux Wiki: Git server](https://wiki.archlinux.org/index.php/Git_server#Web_interfaces) and [Step by step guide on setting up git server in arch linux (pushable)](https://miracoin.wordpress.com/2014/11/25/step-by-step-guide-on-setting-up-git-server-in-arch-linux-pushable/)).
-Note that this is mostly for personal use, so there's no user/authentication control other than that of SSH. Also, most if not all commands here are run as root.
+Note that this is mostly for personal use, so there's no user/authentication control other than that of normal `ssh`. And as with the other entries, most if not all commands here are run as root unless stated otherwise.
-## Prerequisites
+# Table of contents
+
+[TOC]
+
+# Prerequisites
I might get tired of saying this (it's just copy paste, basically)... but you will need the same prerequisites as before (check my [website](https://blog.luevano.xyz/a/website_with_nginx.html) and [mail](https://blog.luevano.xyz/a/mail_server_with_postfix.html) entries), with the extras:
- (Optional, if you want a "front-end") A **CNAME** for "git" and (optionally) "www.git", or some other name for your sub-domains.
- An SSL certificate, if you're following the other entries, add a `git.conf` and run `certbot --nginx` to extend the certificate.
-## Git
+# Git
[Git](https://wiki.archlinux.org/title/git) is a version control system.
@@ -76,14 +81,14 @@ You're basically done. Now you should be able to push/pull repositories to your
```sh
git init --bare {repo_name}.git
-chown -R git:git repo_name.git
+chown -R git:git {repo_name}.git
```
-Those two lines above will need to be run each time you want to add a new repository to your server (yeah, kinda lame... although there are options to "automate" this, I like it this way).
+==Those two lines above will need to be run each time you want to add a new repository to your server==. There are options to "automate" this but I like it this way.
After that you can already push/pull to your repository. I have my repositories (locally) set up so I can push to more than one remote at the same time (my server, GitHub, GitLab, etc.); to do so, check [this gist](https://gist.github.com/rvl/c3f156e117e22a25f242).
-## Cgit
+# Cgit
[Cgit](https://wiki.archlinux.org/title/Cgit) is a fast web interface for git.
@@ -139,11 +144,10 @@ repo.url={url}
repo.path={dir_path}
repo.owner={owner}
repo.desc={short_description}
-
...
```
-Where you can uncomment the `robots` line to let web crawlers (like Google's) to index your `git` web app. And at the end keep all your repositories (the ones you want to make public), for example for my [*dotfiles*](https://git.luevano.xyz/.dots) I have:
+Where you can uncomment the `robots` line to not let web crawlers (like Google's) to index your `git` web app. And at the end keep all your repositories (the ones you want to make public), for example for my [*dotfiles*](https://git.luevano.xyz/.dots) I have:
```apache
...
@@ -156,6 +160,8 @@ repo.desc=These are my personal dotfiles.
Otherwise you could let `cgit` to automatically detect your repositories (you have to be careful if you want to keep "private" repos) using the option `scan-path` and setup `.git/description` for each repository. For more, you can check [cgitrc(5)](https://man.archlinux.org/man/cgitrc.5).
+## Cgit's file rendering
+
By default you can't see the files on the site, you need a highlighter to render the files, I use `highlight`. Install the `highlight` package:
```sh
diff --git a/src/blog/a/mail_server_with_postfix.md b/src/blog/a/mail_server_with_postfix.md
index 63bf564..cd3ba63 100644
--- a/src/blog/a/mail_server_with_postfix.md
+++ b/src/blog/a/mail_server_with_postfix.md
@@ -4,22 +4,27 @@ lang: en
summary: How to create mail server using Postfix, Dovecot, SpamAssassin and OpenDKIM. This is a follow up on post about creating a website with Nginx and Certbot.
tags: server
tools
+ code
tutorial
english
-The entry is going to be long because it's a *tedious* process. This is also based on [Luke Smith's script](https://github.com/LukeSmithxyz/emailwiz), but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I'm in the process of installing/configuring the mail server on a new VPS of mine; also I'm going to be writing a script that does everything in one go (for Arch Linux), that will be hosted [here](https://git.luevano.xyz/server_scripts.git).
+The entry is going to be long because it's a *tedious* process. This is also based on [Luke Smith's script](https://github.com/LukeSmithxyz/emailwiz), but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I'm in the process of installing/configuring the mail server on a new VPS of mine; ~~also I'm going to be writing a script that does everything in one go (for Arch Linux), that will be hosted [here](https://git.luevano.xyz/server_scripts.git).~~ ^^I haven't had time to do the script so nevermind this, if I ever do it I'll make a new entry regarding it.^^
-This configuration works for local users (users that appear in `/etc/passwd`), and does not use any type of SQL Database. And note that most if not all commands executed here are run with root privileges.
+This configuration works for local users (users that appear in `/etc/passwd`), and does not use any type of SQL database. And note that most if not all commands executed here are run with root privileges, unless stated otherwise.
-## Prerequisites
+# Table of contents
+
+[TOC]
+
+# Prerequisites
Basically the same as with the [website with Nginx and Certbot](https://blog.luevano.xyz/a/website_with_nginx.html), with the extras:
- You will need a **CNAME** for "mail" and (optionally) "www.mail", or whatever you want to call the sub-domains (although the [RFC 2181](https://tools.ietf.org/html/rfc2181#section-10.3) states that it NEEDS to be an **A** record, fuck the police).
- An SSL certificate. You can use the SSL certificate obtained following my last post using `certbot` (just create a `mail.conf` and run `certbot --nginx` again).
-- Ports 25, 587 (SMTP), 465 (SMTPS), 143 (IMAP) and 993 (IMAPS) open on the firewall.
+- Ports `25`, `587` (SMTP), `465` (SMTPS), `143` (IMAP) and `993` (IMAPS) open on the firewall (I use `ufw`).
-## Postfix
+# Postfix
[Postfix](https://wiki.archlinux.org/title/postfix) is a "mail transfer agent" which is the component of the mail server that receives and sends emails via SMTP.
@@ -70,7 +75,7 @@ smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
```
-Specify the mailbox home (this is going to be a directory inside your user's home containing the actual mail files):
+Specify the mailbox home, this is going to be a directory inside your user's home containing the actual mail files, for example it will end up being`/home/david/Mail/Inbox`:
```apache
home_mailbox = Mail/Inbox/
@@ -90,9 +95,7 @@ non_smtpd_milters = inet:127.0.0.1:8891
mailbox_command = /usr/lib/dovecot/deliver
```
-Where `{yourdomainname}` is `luevano.xyz` in my case, or if you have `localhost` configured to your domain, then use `localhost` for `myhostname` (`myhostname = localhost`).
-
-Lastly, if you don't want the sender's IP and user agent (application used to send the mail), add the following line:
+Where `{yourdomainname}` is `luevano.xyz` in my case. Lastly, if you don't want the sender's IP and user agent (application used to send the mail), add the following line:
```apache
smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
@@ -149,7 +152,7 @@ systemctl start postfix.service
systemctl enable postfix.service
```
-## Dovecot
+# Dovecot
[Dovecot](https://wiki.archlinux.org/title/Dovecot) is an IMAP and POP3 server, which is what lets an email application retrieve the mail.
@@ -310,9 +313,9 @@ systemctl start dovecot.service
systemctl enable dovecot.service
```
-## OpenDKIM
+# OpenDKIM
-[OpenDKIM](https://wiki.archlinux.org/title/OpenDKIM) is needed so services like G\*\*gle (we don't mention that name here \[\[\[this is a meme\]\]\]) don't throw the mail to the trash. DKIM stands for "DomainKeys Identified Mail".
+[OpenDKIM](https://wiki.archlinux.org/title/OpenDKIM) is needed so services like G\*\*gle don't throw the mail to the trash. DKIM stands for "DomainKeys Identified Mail".
Install the `opendkim` package:
@@ -395,7 +398,9 @@ systemctl start opendkim.service
systemctl enable opendkim.service
```
-And don't forget to add the following **TXT** records on your domain registrar (these examples are for Epik):
+## OpenDKIM DNS TXT records
+
+Add the following **TXT** records on your domain registrar (these examples are for Epik):
1. *DKIM* entry: look up your `{yoursubdomain}.txt` file, it should look something like:
@@ -405,7 +410,7 @@ And don't forget to add the following **TXT** records on your domain registrar (
"..." ) ; ----- DKIM key mail for {yourdomain}
```
-In the TXT record you will place `{yoursubdomain}._domainkey` as the "Host" and `"v=DKIM1; k=rsa; s=email; " "p=..." "..."` in the "TXT Value" (replace the dots with the actual value you see in your file).
+In the **TXT** record you will place `{yoursubdomain}._domainkey` as the "Host" and `"v=DKIM1; k=rsa; s=email; " "p=..." "..."` in the "TXT Value" (replace the dots with the actual value you see in your file).
2. *DMARC* entry: just `_dmarc.{yourdomain}` as the "Host" and `"v=DMARC1; p=reject; rua=mailto:dmarc@{yourdomain}; fo=1"` as the "TXT Value".
@@ -413,7 +418,7 @@ In the TXT record you will place `{yoursubdomain}._domainkey` as the "Host" and
And at this point you could test your mail for spoofing and more.
-## SpamAssassin
+# SpamAssassin
[SpamAssassin](https://wiki.archlinux.org/title/SpamAssassin) is just *a mail filter to identify spam*.
@@ -492,13 +497,13 @@ systemctl start spamassassin.service
systemctl enable spamassassin.service
```
-## Wrapping up
+# Wrapping up
-We should have a working mail server by now. Before continuing check your journal logs (`journalctl -xe --unit={unit}`, where `{unit}` could be `spamassassin.service` for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere (the logs are generally really descriptive) because all the settings and steps detailed here just (literally just finished doing everything on a new server as of the writing of this text) worked *(((it just werks on my machine)))*.
+We should have a working mail server by now. Before continuing check your journal logs (`journalctl -xe --unit={unit}`, where `{unit}` could be `spamassassin.service` for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere because all the settings and steps detailed here just worked; I literally just finished doing everything on a new server as of the writing of this text, ==it just werks on my machine==.
Now, to actually use the mail service: first of all, you need a *normal* account (don't use root) that belongs to the `mail` group (`gpasswd -a user group` to add a user `user` to group `group`) and that has a password.
-Next, to actually login into a mail app/program/whateveryouwanttocallit, you will use the following settings, at least for `thunderdbird`(I tested in windows default mail app and you don't need a lot of settings):
+Next, to actually login into a mail app/program, you will use the following settings, at least for `thunderdbird`(I tested in windows default mail app and you don't need a lot of settings):
- \* server: subdomain.domain (mail.luevano.xyz in my case)
- **SMTP** port: 587
@@ -512,6 +517,4 @@ Next, to actually login into a mail app/program/whateveryouwanttocallit, you wil
All that's left to do is test your mail server for spoofing, and to see if everything is setup correctly. Go to [DKIM Test](https://www.appmaildev.com/en/dkim) and follow the instructions (basically click next, and send an email with whatever content to the email that they provide). After you send the email, you should see something like:
-![DKIM Test successful](images/b/notes/mail/dkim_test_successful.png "DKIM Test successful")
-
-Finally, that's actually it for this entry, if you have any problem whatsoever you can [contact me](https://luevano.xyz/contact.html).
+![DKIM Test successful](${SURL}/images/b/notes/mail/dkim_test_successful.png "DKIM Test successful")
diff --git a/src/blog/a/new_blogging_system.md b/src/blog/a/new_blogging_system.md
index a855259..7252a2c 100644
--- a/src/blog/a/new_blogging_system.md
+++ b/src/blog/a/new_blogging_system.md
@@ -11,10 +11,12 @@ So, I was tired of working with `ssg` (and then `sbg` which was a modified versi
The solution? Write a new program "from scratch" in *pYtHoN*. Yes it is bloated, yes it is in its early stages, but it works just as I want it to work, and I'm pretty happy so far with the results and have with even more ideas in mind to "optimize" and generally clean my wOrKfLoW to post new blog entries. I even thought of using it for posting into a "feed" like gallery for drawings or pictures in general.
-I called it [`pyssg`](https://github.com/luevano/pyssg), because it sounds nice and it wasn't taken in the PyPi. It is just a terminal program that reads either a configuration file or the options passed as flags when calling the program.
+I called it [`pyssg`](${PYSSG_URL}), because it sounds nice and it wasn't taken in the PyPi. It is just a terminal program that reads either a configuration file or the options passed as flags when calling the program.
It still uses Markdown files because I find them very easy to work with. And instead of just having a "header" and a "footer" applied to each parsed entry, you will have templates (generated with the program) for each piece that I thought made sense (idea taken from `blogit`): the common header and footer, the common header and footer for each entry and, header, footer and list elements for articles and tags. When parsing the Markdown file these templates are applied and stitched together to make a single HTML file. Also generates an RSS feed and the `sitemap.xml` file, which is nice.
-It might sound convoluted, but it works pretty well, with of course room to improve; I'm open to suggestions, issue reporting or direct contributions [here](https://github.com/luevano/pyssg). BTW, it only works on Linux for now (and don't think on making it work on windows, but feel free to do PR for the compatibility).
+It might sound convoluted, but it works pretty well, with of course room to improve; I'm open to suggestions, issue reporting or direct contributions [here](https://github.com/luevano/pyssg). For now, it is only tested on Linux (and don't think on making it work on windows, but feel free to do PR for the compatibility).
That's it for now, the new RSS feed is available here: [https://blog.luevano.xyz/rss.xml](https://blog.luevano.xyz/rss.xml).
+
+**Update**: Since writing this entry, [`pyssg`](${PYSSG_URL}) has evolved quite a bit, so not everything described here is still true. For the latest updates check the newest entries or the git repository itself.
diff --git a/src/blog/a/password_manager_authenticator_setup.md b/src/blog/a/password_manager_authenticator_setup.md
index f0e8c76..9c5a03b 100644
--- a/src/blog/a/password_manager_authenticator_setup.md
+++ b/src/blog/a/password_manager_authenticator_setup.md
@@ -8,7 +8,7 @@ tags: tools
**Disclaimer**: I won't go into many technical details here of how to install/configure/use the software, this is just supposed to be a short description on my setup.
-It's been a while since I started using a password manager at all, and I'm happy that I started with [KeePassXC](https://keepassxc.org/) (open source, multiplatform password manager that it's completely offline) as a direct recommendation from [lm](https://www.lmcj.xyz/); before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by [Leo](https://askleo.com/different-passwords-for-everything/) (I don't personally recommed LastPass as Leo does). Note that you will still need a *master password* to lock/unlock your password database (you can additionally use a hardware key and a key file).
+It's been a while since I started using a password manager at all, and I'm happy that I started with [KeePassXC](https://keepassxc.org/) (open source, multiplatform password manager that it's completely offline) as a direct recommendation from [==EL ELE EME==](https://www.lmcj.xyz/); before this I was using the same password for everything (like a lot of people), which is a well know privacy issue as noted in detail by [Leo](https://askleo.com/different-passwords-for-everything/) (I don't personally recommed LastPass as Leo does). Note that you will still need a *master password* to lock/unlock your password database (you can additionally use a hardware key and a key file).
Anyways, setting up *keepass* is pretty simple, as there is a client for almost any device; note that *keepass* is basically just the format and the base for all of the clients, as its common with pretty much any open source software. In my case I'm using [KeePassXC](https://keepassxc.org/) in my computer and [KeePassDX](https://www.keepassdx.com/) in my phone (Android). The only concern is keeping everything in sync because *keepass* doesn't have any automatic method of synchronizing between devices because of security reasons (as far as I know), meaning that you have to manage that yourself.
diff --git a/src/blog/a/rewrote_pyssg_again.md b/src/blog/a/rewrote_pyssg_again.md
index 70ec8dd..b00538c 100644
--- a/src/blog/a/rewrote_pyssg_again.md
+++ b/src/blog/a/rewrote_pyssg_again.md
@@ -7,8 +7,8 @@ tags: update
short
english
-I've been wanting to change the way [pyssg](https://github.com/luevano/pyssg) reads config files and generates `HTML` files so that it is more flexible and I don't need to have 2 separate build commands and configs (for [blog](https://blog.luevano.xyz) and [art](https://art.luevano.xyz)), and also to handle other types of "sites"; because `pyssg` was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of *rewrite* `pyssg`, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.
+I've been wanting to change the way [`pyssg`](https://github.com/luevano/pyssg) reads config files and generates `HTML` files so that it is more flexible and I don't need to have 2 separate build commands and configs (for [blog](https://blog.luevano.xyz) and [art](https://art.luevano.xyz)), and also to handle other types of "sites"; because `pyssg` was built with blogging in mind, so it was a bit limited to how it could be used. So I had to kind of *rewrite* `pyssg`, and with the latest version I can now generate the whole site and use the same templates for everything, quite neat for my use case.
Anyways, so I bought a new domain for all `pyssg` related stuff, mostly because I wanted somewhere to test live builds while developing, it is of course [pyssg.xyz](https://pyssg.xyz); as of now it is the same template, CSS and scripts that I use here, probably will change in the future. I'll be testing new features and anything `pyssg` related stuff.
-I should start pointing all links to `pyssg` to the actual site instead of the github repository (or my [git](https://git.luevano.xyz) repository), but I haven't decided how to handle everything. \ No newline at end of file
+I should start pointing all links to `pyssg` to the actual site instead of the github repository (or my [git](https://git.luevano.xyz) repository), but I haven't decided how to handle everything.
diff --git a/src/blog/a/tenia_esto_descuidado.md b/src/blog/a/tenia_esto_descuidado.md
index 1d90745..6b31530 100644
--- a/src/blog/a/tenia_esto_descuidado.md
+++ b/src/blog/a/tenia_esto_descuidado.md
@@ -1,4 +1,4 @@
-title: Tenia este pex algo descuidado
+title: Tenía este pex algo descuidado
author: David Luévano
lang: es
summary: Nada más un update en el estado del blog y lo que he andado haciendo.
@@ -8,12 +8,12 @@ tags: short
Así es, tenía un poco descuidado este pex, siendo la razón principal que andaba ocupado con cosas de *la vida profesional*, ayay. Pero ya que ando un poco más despejado y menos estresado voy a seguir usando el blog y a ver qué más hago.
-Tengo unas entradas pendientes que quiero hacer del estilo de "tutorial" o "how-to", pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en [landchad.net](https://landchad.net/), lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por [lm](https://lmcj.xyz/)); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he *setupeado* desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.
+Tengo unas entradas pendientes que quiero hacer del estilo de "tutorial" o "how-to", pero me lo he estado debatiendo, porque Luke ya empezó a hacerlo más de verdad en [landchad.net](https://landchad.net/), lo cual recomiendo bastante pues igual yo empecé a hacer esto por él (y por [==EL ELE EME==](https://lmcj.xyz/)); aunque la verdad pues es muy específico a como él hace las cosas y quizá sí puede haber diferencias, pero ya veré en estos días. La próxima que quiero hacer es sobre el VPN, porque no lo he *setupeado* desde que reinicié El Página Web y La Servidor, entonces acomodaré el VPN de nuevo y de pasada tiro entrada de eso.
-También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el *está bien cabrón* pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento (sí, me mamé).
+También dejé un dibujo pendiente, que la neta lo dejé por 2 cosas: está bien cabrón (porque también lo quiero colorear) y porque estaba ocupado; de lo cuál ya sólo queda el *está bien cabrón* pero no he tenido el valor de retomarlo. Lo triste es que ya pasó el tiempo del hype y ya no tengo mucha motivación para terminarlo más que el hecho de que cuando lo termine empezaré a usar Clip Studio Paint en vez de Krita, porque compré una licencia ahora que estuvo en 50% de descuento.
Algo bueno es que me he estado sintiendo muy bien conmigo mismo últimamente, aunque casi no hable de eso. Sí hay una razón en específico, pero es una razón algo tonta. Espero así siga.
-Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien *bloated*, entonces pues me voy a hacer una en corto seguramente en Python para *el back*, MySQL para la base de datos y Javascript para la conexión acá en *el front*, algo tranqui.
+~~Ah, y también quería acomodarme una sección de comentarios, pero como siempre, todas las opciones están bien *bloated*, entonces pues me voy a hacer una en corto seguramente en Python para *el back*, MySQL para la base de datos y Javascript para la conexión acá en *el front*, algo tranqui.~~ ^^Nel, siempre no ocupo esto, pa' qué.^^
Sobres pues.
diff --git a/src/blog/a/volviendo_a_usar_la_pagina.md b/src/blog/a/volviendo_a_usar_la_pagina.md
index de6d0cc..265f6f0 100644
--- a/src/blog/a/volviendo_a_usar_la_pagina.md
+++ b/src/blog/a/volviendo_a_usar_la_pagina.md
@@ -8,8 +8,8 @@ tags: short
Después de mucho tiempo de estar luchando con querer volver a usar este pex (maldita *d* word y demás), ya me volví a acomodar el setup para agregar nuevas entradas.
-Entre las cosas que tuve que hacer fue actualizar el [pyssg](https://github.com/luevano/pyssg) porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder *buildear* la página completa; por ahora se hace en segmentos: todo lo de [luevano.xyz](https://luevano.xyz) está hecho manual, mientras que [blog](https://blog.luevano.xyz) y [art](https://art.luevano.xyz) usan [pyssg](https://github.com/luevano/pyssghttps://github.com/luevano/pyssg).
+Entre las cosas que tuve que hacer fue actualizar el [`pyssg`](${PYSSG_URL}) porque no lo podía usar de una como estaba; y de pasado le agregue una que otra feature nueva. Luego quiero agregarle más funcionalidad para poder *buildear* la página completa; por ahora se hace en segmentos: todo lo de [luevano.xyz](https://luevano.xyz) está hecho manual, mientras que [blog](https://blog.luevano.xyz) y [art](https://art.luevano.xyz) usan [pyssg](${PYSSG_URL}).
Otra cosa es que quizá me devuelva a editar alguans entradas nada más para homogeneizar las entradas específicas a *Create a...* (tiene más sentido que sean *Setup x...* o algo similar).
-En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno por problemas debidos a varias razones (del jale). Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto *\*thinking emoji\**.
+En otras noticias, estoy muy agusto en el jale que tengo actualmente aunque lleve alrededor de 3 semanas de un infierno en el jale. Debo pensar en si debo omitir cosas personales o del trabajo aquí, ya que quién sabe quién se pueda llegar a topar con esto *\*thinking emoji\**.
diff --git a/src/blog/a/vpn_server_with_openvpn.md b/src/blog/a/vpn_server_with_openvpn.md
index 7346264..f36d845 100644
--- a/src/blog/a/vpn_server_with_openvpn.md
+++ b/src/blog/a/vpn_server_with_openvpn.md
@@ -4,6 +4,7 @@ lang: en
summary: How to create a VPN server using OpenVPN on a server running Nginx. Only for IPv4.
tags: server
tools
+ code
tutorial
english
@@ -11,16 +12,20 @@ I've been wanting to do this entry, but had no time to do it since I also have t
Like with any other of my entries I based my setup on the [Arch Wiki](https://wiki.archlinux.org/title/OpenVPN), [this install script](https://github.com/Nyr/openvpn-install) and [this profile generator script](https://github.com/graysky2/ovpngen).
-This will be installed and working alongside the other stuff I've wrote about on other posts (see the [server](https://blog.luevano.xyz/tag/@server.html) tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it's not that hard to include IPv6, but meh).
+This will be installed and working alongside the other stuff I've wrote about on other posts (see the [server](https://blog.luevano.xyz/tag/@server.html) tag). All commands here are executes as root unless specified otherwise. Also, this is intended only for IPv4 (it's not that hard to include IPv6, but meh). As always, all commands are executed as root unless stated otherwise.
-## Prerequisites
+# Table of contents
+
+[TOC]
+
+# Prerequisites
Pretty simple:
-- Working server with root access, and with Ufw as the firewall.
-- Depending on what port you want to run the VPN on, the default `1194`, or as a fallback on `443` (click [here](https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/) for more). I will do mine on port `1194` but it's just a matter of changing 2 lines of configuration and one Ufw rule.
+- Working server with root access, and with `ufw` as the firewall.
+- Depending on what port you want to run the VPN on, the default `1194`, or as a fallback on `443` (click [here](https://openvpn.net/vpn-server-resources/advanced-option-settings-on-the-command-line/) for more). I will do mine on port `1194` but it's just a matter of changing 2 lines of configuration and one `ufw` rule.
-## Create PKI from scratch
+# Create PKI from scratch
PKI stands for *Public Key Infrastructure* and basically it's required for certificates, private keys and more. This is supposed to work between two servers and one client: a server in charge of creating, signing and verifying the certificates, a server with the OpenVPN service running and the client making the request.
@@ -92,9 +97,9 @@ openvpn --genkey secret ta.key
That's it for the PKI stuff and general certificate configuration.
-## OpenVPN
+# OpenVPN
-[OpenVPN](https://wiki.archlinux.org/title/OpenVPN) is a robust and highly flexible VPN daemon, that's pretty complete feature wise.
+[OpenVPN](https://wiki.archlinux.org/title/OpenVPN) is a robust and highly flexible VPN daemon, that's pretty complete feature-wise.
Install the `openvpn` package:
@@ -204,6 +209,8 @@ explicit-exit-notify 1
`#` and `;` are comments. Read each and every line, you might want to change some stuff (like the logging), specially the first line which is your server public IP.
+### Enable forwarding
+
Now, we need to enable *packet forwarding* (so we can access the web while connected to the VPN), which can be enabled on the interface level or globally (you can check the different options with `sysctl -a | grep forward`). I'll do it globally, run:
```sh
@@ -272,7 +279,7 @@ systemctl enable openvpn-server@server.service
Where the `server` after `@` is the name of your configuration, `server.conf` without the `.conf` in my case.
-### Create client configurations
+## Create client configurations
You might notice that I didn't specify how to actually connect to our server. For that we need to do a few more steps. We actually need a configuration file similar to the `server.conf` file that we created.
@@ -357,6 +364,6 @@ chmod o+r pki/crl.pem
cd $CPWD
```
-And the way to use is to run `vpn_script new/rev client_name` as sudo (when revoking, it doesn't actually deletes the `.ovpn` file in `~/ovpn`). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for `easy-rsa`) and it could have errors.
+And the way to use is to run `vpn_script new/rev client_name` as sudo (when revoking, it doesn't actually delete the `.ovpn` file in `~/ovpn`). Again, this is a little script that I put together, so you should check it out, it may need tweaks (depending on your directory structure for `easy-rsa`).
Now, just get the `.ovpn` file generated, import it to OpenVPN in your client of preference and you should have a working VPN service.
diff --git a/src/blog/a/website_with_nginx.md b/src/blog/a/website_with_nginx.md
index 7e4624a..11d4406 100644
--- a/src/blog/a/website_with_nginx.md
+++ b/src/blog/a/website_with_nginx.md
@@ -4,25 +4,30 @@ lang: en
summary: How to create website that runs on Nginx and uses Certbot for SSL certificates. This is a base for future blog posts about similar topics.
tags: server
tools
+ code
tutorial
english
These are general notes on how to setup a Nginx web server plus Certbot for SSL certificates, initially learned from [Luke's video](https://www.youtube.com/watch?v=OWAqilIVNgE) and after some use and research I added more stuff to the mix. And, actually at the time of writing this entry, I'm configuring the web server again on a new VPS instance, so this is going to be fresh.
-As a side note, (((i use arch btw))) so everything here es aimed at an Arch Linux distro, and I'm doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.
+As a side note, ==i use arch btw== so everything here es aimed at an Arch Linux distro, and I'm doing everything on a VPS. Also note that most if not all commands here are executed with root privileges.
-## Prerequisites
+# Table of contents
+
+[TOC]
+
+# Prerequisites
You will need two things:
- A domain name (duh!). I got mine on [Epik](https://www.epik.com/?affid=da5ne9ru4) (affiliate link, btw).
- - With the corresponding **A** and **AAA** records pointing to the VPS' IPs ("A" record points to the ipv4 address and "AAA" to the ipv6, basically). I have three records for each type: empty one, "www" and "\*" for a wildcard, that way "domain.name", "www.domain.name", "anythingelse.domain.name" point to the same VPS (meaning that you can have several VPS for different sub-domains).
-- A VPS or somewhere else to host it. I'm using [Vultr](https://www.vultr.com/?ref=8732849) (also an affiliate link).
+ - With the corresponding **A** and **AAA** records pointing to the VPS' IPs. I have three records for each type: empty string, "www" and "\*" for a wildcard, that way "domain.name", "www.domain.name", "anythingelse.domain.name" point to the same VPS (meaning that you can have several VPS for different sub-domains). These depend on the VPS provider.
+- A VPS or somewhere else to host it. I'm using [Vultr](https://www.vultr.com/?ref=8732849) (also an affiliate link, btw).
- With `ssh` already configured both on the local machine and on the remote machine.
- - Firewall already configured to allow ports 80 (HTTP) and 443 (HTTPS). I use `ufw` so it's just a matter of doing `ufw allow 80,443/tcp` as root and you're golden.
- - `cron` installed if you follow along (you could use `systemd` timers, or some other method you prefer to automate running commands every X time).
+ - Firewall already configured to allow ports `80` (HTTP) and `443` (HTTPS). I use `ufw` so it's just a matter of doing `ufw allow 80,443/tcp` (for example) as root and you're golden.
+ - `cron` installed if you follow along (you could use `systemd` timers, or some other method you prefer to automate running commands every certain time).
-## Nginx
+# Nginx
[Nginx](https://wiki.archlinux.org/title/Nginx) is a web (HTTP) server and reverse proxy server.
@@ -36,7 +41,7 @@ systemctl start nginx.service
And that's it, at this point you can already look at the default initial page of Nginx if you enter the IP of your server in a web browser. You should see something like this:
-![Nginx welcome page](images/b/notes/nginx/nginx_welcome_page.png "Nginx welcome page")
+![Nginx welcome page](${SURL}/images/b/notes/nginx/nginx_welcome_page.png "Nginx welcome page")
As stated in the welcome page, configuration is needed, head to the directory of Nginx:
@@ -121,7 +126,7 @@ systemctl restart nginx
If everything goes correctly, you can now go to your website by typing `domain.name` on a web browser. But you will see a "404 Not Found" page like the following (maybe with different Nginx version):
-![Nginx 404 Not Found page](images/b/notes/nginx/nginx_404_page.png "Nginx 404 Not Found page")
+![Nginx 404 Not Found page](${SURL}/images/b/notes/nginx/nginx_404_page.png "Nginx 404 Not Found page")
That's no problem, because it means that the web server it's actually working. Just add an `index.html` file with something simple to see it in action (in the `/var/www/some_folder` that you decided upon). If you keep seeing the 404 page make sure your `root` line is correct and that the directory/index file exists.
@@ -137,7 +142,7 @@ server {
...
```
-## Certbot
+# Certbot
[Certbot](https://wiki.archlinux.org/title/Certbot) is what provides the SSL certificates via [Let's Encrypt](https://letsencrypt.org/).
@@ -161,6 +166,6 @@ Now, the certificate given by `certbot` expires every 3 months or something like
crontab -e
```
-And a file will be opened where you need to add a new rule for Certbot, just append the line: `1 1 1 * * certbot renew` (renew on the first day of every month) and you're good. Alternatively use `systemd` timers as stated in the [Arch Linux Wiki](https://wiki.archlinux.org/title/Certbot#Automatic_renewal).
+And a file will be opened where you need to add a new rule for Certbot, just append the line: `1 1 1 * * certbot renew --quiet --agree-tos --deploy-hook "systemctl reload nginx.service"` (renew on the first day of every month) and you're good. Alternatively use `systemd` timers as stated in the [Arch Linux Wiki](https://wiki.archlinux.org/title/Certbot#Automatic_renewal).
That's it, you now have a website with SSL certificate.
diff --git a/src/blog/a/xmpp_server_with_prosody.md b/src/blog/a/xmpp_server_with_prosody.md
index e3ed291..bf25e9d 100644
--- a/src/blog/a/xmpp_server_with_prosody.md
+++ b/src/blog/a/xmpp_server_with_prosody.md
@@ -4,16 +4,23 @@ lang: en
summary: How to create an XMPP server using Prosody on a server running Nginx. This server will be compatible with at least Conversations and Movim.
tags: server
tools
+ code
tutorial
english
-Recently I set up an XMPP server (and a Matrix one, too) for my personal use and for friends if they want one; made one for ==[EL ELE EME](https://lmcj.xyz)== for example. So, here are the notes on how I set up the server that is compatible with the [Conversations](https://conversations.im/) app and the [Movim](https://movim.eu/) social network. You can see my addresses in [contact](https://luevano.xyz/contact.html) and the XMPP compliance/score of the server.
+**Update**: I no longer host this XMPP server as it consumed a lot of resources and I wasn't using it that much. I'll probably re-create it in the future, though.
-One of the best resources I found that helped me a lot was [Installing and Configuring Prosody XMPP Server on Debian 9](https://community.hetzner.com/tutorials/prosody-debian9), and of course the [Arch Wiki](https://wiki.archlinux.org/title/Prosody) and the [oficial documentation](https://prosody.im/).
+Recently I set up an [XMPP](https://xmpp.org/) server (and a Matrix one, too) for my personal use and for friends if they want one; made one for [==EL ELE EME==](https://lmcj.xyz) for example. So, here are the notes on how I set up the server that is compatible with the [Conversations](https://conversations.im/) app and the [Movim](https://movim.eu/) social network. You can see my addresses at [contact](https://luevano.xyz/contact.html) and the XMPP compliance/score of the server.
-As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root (unless specified otherwise)
+One of the best resources I found that helped me a lot was [Installing and Configuring Prosody XMPP Server on Debian 9](https://community.hetzner.com/tutorials/prosody-debian9), the [Arch Wiki](https://wiki.archlinux.org/title/Prosody) and the [oficial documentation](https://prosody.im/).
-## Prerequisites
+As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root, unless specified otherwise.
+
+# Table of contents
+
+[TOC]
+
+# Prerequisites
Same as with my other entries ([website](https://luevano.xyz/a/website_with_nginx.html), [mail](https://blog.luevano.xyz/a/mail_server_with_postfix.html) and [git](https://blog.luevano.xyz/a/git_server_with_cgit.html)) plus:
@@ -24,14 +31,14 @@ Same as with my other entries ([website](https://luevano.xyz/a/website_with_ngin
- `proxy`: a proxy in case one of the users needs it.
- `vjud`: user directory.
- (Optionally, but recommended) the following **SRV** DNS records; make sure it is pointing to an **A** or **AAA** record (matching the records from the last point, for example):
- - `_xmpp-client._tcp.**your.domain**.` for port `5222` pointing to `xmpp.**your.domain**.`
- - `_xmpp-server._tcp.**your.domain**.` for port `5269` pointing to `xmpp.**your.domain**.`
- - `_xmpp-server._tcp.muc.**your.domain**.` for port `5269` pointing to `xmpp.**your.domain**.`
+ - `_xmpp-client._tcp.{your.domain}.` for port `5222` pointing to `xmpp.{your.domain}.`
+ - `_xmpp-server._tcp.{your.domain}.` for port `5269` pointing to `xmpp.{your.domain}.`
+ - `_xmpp-server._tcp.muc.{your.domain}.` for port `5269` pointing to `xmpp.{your.domain}.`
* SSL certificates for the previous subdomains; similar that with my other entries just create the appropriate `prosody.conf` (where `server_name` will be all the subdomains defined above) file and run `certbot --nginx`. You can find the example configuration file almost at the end of this entry.
- Email addresses for `admin`, `abuse`, `contact`, `security`, etc. Or use your own email for all of them, doesn't really matter much as long as you define them in the configuration and are valid, I have aliases so those emails are forwarded to me.
- Allow ports `5000`, `5222`, `5269`, `5280` and `5281` for [Prosody](https://prosody.im/doc/ports) and, `3478` and `5349` for [Turnserver](https://webrtc.org/getting-started/turn-server) which are the defaults for `coturn`.
-## Prosody
+# Prosody
[Prosody](https://wiki.archlinux.org/title/Prosody) is an implementation of the XMPP protocol that is flexible and extensible.
@@ -54,11 +61,11 @@ You can see that I follow a similar approach that I used with Nginx and the serv
Make symbolic links to the following modules:
```
-ln -s /var/lib/prosody/modules-available/MODULE_NAME /var/lib/prosody/modules-enabled/
+ln -s /var/lib/prosody/modules-available/{module_name} /var/lib/prosody/modules-enabled/
...
```
-- Modules:
+- Modules (`{module_name}`):
- `mod_bookmarks`
- `mod_cache_c2s_caps`
- `mod_checkcerts`
@@ -407,9 +414,9 @@ ln -s your.domain.key SUBDOMAIN.your.domain.key
That's basically all the configuration that needs Prosody itself, but we still have to configure Nginx and Coturn before starting/enabling the `prosody` service.
-## Nginx configuration file
+# Nginx configuration file
-Since this is not an ordinary configuration file I'm going to describe this too. Your `prosody.conf` file should have the following location blocks under the main server block (the one that listens to HTTPS):
+Since this is not an ordinary configuration file I'm going to describe this, too. Your `prosody.conf` file should have the following location blocks under the main server block (the one that listens to HTTPS):
```nginx
# HTTPS server block
@@ -515,14 +522,14 @@ And `host-meta.json` file:
}
```
-Remember to have your `prosody.conf` file symlinked (or discoverable by Nginx) to the `sites-enabled` directory. You can now restart your `nginx` service (and test the configuration, optionally):
+Remember to have your `prosody.conf` file symlinked (or discoverable by Nginx) to the `sites-enabled` directory. You can now test and restart your `nginx` service (and test the configuration, optionally):
```sh
nginx -t
systemctl restart nginx.service
```
-## Coturn
+# Coturn
[Coturn](https://github.com/coturn/coturn) is the implementation of TURN and STUN server, which in general is for (at least in the XMPP world) voice support and external service discovery.
@@ -551,7 +558,7 @@ systemctl enable turnserver.service
You can test if your TURN server works at [Trickle ICE](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/). You may need to add a user in the `turnserver.conf` to test this.
-## Wrapping up
+# Wrapping up
At this point you should have a working XMPP server, start/enable the `prosody` service now:
@@ -576,4 +583,4 @@ Additionally, you can test the security of your server in [IM Observatory](https
You can now log in into your XMPP client of choice, if it asks for the server it should be `xmpp.your.domain` (or `your.domain` for some clients) and your login credentials `you@your.domain` and the password you chose (which you can change in most clients).
-That's it, send me a message <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.
+That's it, send me a message at <a href="xmpp:david@luevano.xyz">david@luevano.xyz</a> if you were able to set up the server successfully.
diff --git a/src/blog/g/flappybird_godot_devlog_1.md b/src/blog/g/flappybird_godot_devlog_1.md
index 44a5f36..ad54393 100644
--- a/src/blog/g/flappybird_godot_devlog_1.md
+++ b/src/blog/g/flappybird_godot_devlog_1.md
@@ -4,9 +4,10 @@ lang: en
summary: Since I'm starting to get more into gamedev stuff, I'll start blogging about it just to keep consistent. This shows as "devlog 1" just in case I want to include more parts for extra stuff.
tags: gamedev
godot
+ gdscript
english
-I just have a bit of experience with Godot and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:
+I just have a bit of experience with *Godot* and with gamedev in general, so I started with this game as it is pretty straight forward. On a high level the main characteristics of the game are:
- Literally just one sprite going up and down.
- Constant horizontal move of the world/player.
@@ -19,203 +20,208 @@ Not going to specify all the details, only the needed parts and what could be co
One thing to note, is that I started writing this when I finished the game, so it's hard to go part by part, and it will be hard to test individual parts when going through this as everything is depending on each other. For the next devlog, I'll do it as I go and it will include all the changes to the nodes/scripts as I was finding them, probably better idea and easier to follow.
-The source code can be found in my GitHub [here](https://github.com/luevano/flappybird_godot), it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I'm too lazy to make it configurable, it was the last thing I added), or you could also go to the itch.io page I setup where it's playable in the browser:
+The source code can be found in my GitHub [here](https://github.com/luevano/flappybird_godot), it also contains the exported versions for HTML5, Windows and Linux (be aware that the sound might be too high and I'm too lazy to make it configurable, it was the last thing I added), or you could also go to the [itch.io](https://lorentzeus.itch.io/flappybirdgodot) page I setup where it's playable in the browser:
-<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1551015?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/flappybirdgodot">FlappyBirdGodot by Lorentzeus</a></iframe></p>
-## Initial project setup
+# Table of contents
-### Directory structure
+[TOC]
+
+# Initial setup
+
+## Directory structure
I'm basically going with what I wrote on [Godot project structure](https://blog.luevano.xyz/g/godot_project_structure.html) recently, and probably with minor changes depending on the situation.
-### Config
+## Config
-#### Default import settings
+### Default import settings
Since this is just pixel art, the importing settings for textures needs to be adjusted so the sprites don't look blurry. Go to *Project -> Project settings... -> Import defaults* and on the drop down select `Texture`, untick everything and make sure *Compress/Mode* is set to `Lossless`.
-![Project settings - Import defaults - Texture settings](images/g/flappybird_godot/project_settings_import_texture.png "Project settings - Import defaults - Texture settings")
+![Project settings - Import defaults - Texture settings](${SURL}/images/g/flappybird_godot/project_settings_import_texture.png "Project settings - Import defaults - Texture settings")
-#### General settings
+### General settings
It's also a good idea to setup some config variables project-wide. To do so, go to *Project -> Project settings... -> General*, select *Application/config* and add a new property (there is a text box at the top of the project settings window) for game scale: `application/config/game_scale` for the type use `float` and then click on add; configure the new property to `3.0`; On the same window, also add `application/config/version` as a `string`, and make it `1.0.0` (or whatever number you want).
-![Project settings - General - Game scale and version properties](images/g/flappybird_godot/project_settings_config_properties.png "Project settings - General - Game scale and version properties")
+![Project settings - General - Game scale and version properties](${SURL}/images/g/flappybird_godot/project_settings_config_properties.png "Project settings - General - Game scale and version properties")
-For my personal preferences, also disable some of the *GDScript* debug warnings that are annoying, this is done at *Project -> Project settings... -> General*, select *Debug/GDScript* and toggle off "Unused arguments", "Unused signal" and "Return value discarded", and any other that might come up too often and don't want to see.
+For my personal preferences, also disable some of the *GDScript* debug warnings that are annoying, this is done at *Project -> Project settings... -> General*, select *Debug/GDScript* and toggle off `Unused arguments`, `Unused signal` and `Return value discarded`, and any other that might come up too often and don't want to see.
-![Project settings - General - GDScript debug warnings](images/g/flappybird_godot/project_settings_debug_gdscript.png "Project settings - General - GDScript debug warnings")
+![Project settings - General - GDScript debug warnings](${SURL}/images/g/flappybird_godot/project_settings_debug_gdscript.png "Project settings - General - GDScript debug warnings")
-Finally, set the initial window size in *Project -> Project settings... -> General*, select *Display/Window* and set *Size/Width* and *Size/Height* to `600` and `800`, respectively. As well as the *Stretch/Mode* to "viewport", and *Stretch/Aspect* to "keep":
+Finally, set the initial window size in *Project -> Project settings... -> General*, select *Display/Window* and set *Size/Width* and *Size/Height* to `600` and `800`, respectively. As well as the *Stretch/Mode* to `viewport` , and *Stretch/Aspect* to `keep`:
-![Project settings - General - Initial window size](images/g/flappybird_godot/project_settings_window_settings.png "Project settings - General - Initial window size")
+![Project settings - General - Initial window size](${SURL}/images/g/flappybird_godot/project_settings_window_settings.png "Project settings - General - Initial window size")
-#### Keybindings
+### Keybindings
-I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the `Input.something()` API can be used), go to *Project -> Project settings... -> Input Map* and on the text box write "jump" and click add, then it will be added to the list and it's just a matter of clicking the `+` sign to add a "Physical key", press any key you want to be used to jump and click ok. Do the same for the rest of the actions.
+I only used 3 actions (keybindings): jump, restart and toggle_debug (optional). To add custom keybindings (so that the `Input.something()` API can be used), go to *Project -> Project settings... -> Input Map* and on the text box write `jump` and click add, then it will be added to the list and it's just a matter of clicking the `+` sign to add a *Physical key*, press any key you want to be used to jump and click ok. Do the same for the rest of the actions.
-![Project settings - Input Map - Adding necessary keybindings](images/g/flappybird_godot/project_settings_input_map.png "Project settings - Input Map - Adding necessary keybindings")
+![Project settings - Input Map - Adding necessary keybindings](${SURL}/images/g/flappybird_godot/project_settings_input_map.png "Project settings - Input Map - Adding necessary keybindings")
-#### Layers
+### Layers
-Finally, rename the physics layers so we don't lose track of which layer is which. Go to *Project -> Layer Names -> 2d Physics* and change the first 5 layer names to (in order): "player", "ground", "pipe", "ceiling" and "score".
+Finally, rename the physics layers so we don't lose track of which layer is which. Go to *Project -> Layer Names -> 2d Physics* and change the first 5 layer names to (in order): `player`, `ground`, `pipe`, `ceiling` and `score`.
-![Project settings - Layer Names - 2D Physics](images/g/flappybird_godot/project_settings_layer_names_2d_physics.png "Project settings - Layer Names - 2D Physics")
+![Project settings - Layer Names - 2D Physics](${SURL}/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png "Project settings - Layer Names - 2D Physics")
-## Assets
+# Assets
For the assets I found out about a pack that contains just what I need: [flappy-bird-assets](https://megacrash.itch.io/flappy-bird-assets) by [MegaCrash](https://megacrash.itch.io/); I just did some minor modifications on the naming of the files. For the font I used [Silver](https://poppyworks.itch.io/silver), and for the sound the resources from [FlappyBird-N64](https://github.com/meeq/FlappyBird-N64) (which seems to be taken from [101soundboards.com](https://www.101soundboards.com/boards/10178-flappy-bird-sounds) which the orignal copyright holder is [.Gears](https://dotgears.com/) anyways).
-### Importing
+## Importing
-Create the necessary directories to hold the respective assets and it's just a matter of dragging and dropping, I used directories: `res://entities/actors/player/sprites/`, `res://fonts/`, `res://levels/world/background/sprites/`, `res://levels/world/ground/sprites/`, `res://levels/world/pipe/sprites/`, `res://sfx/`. For the player sprites, the "FileSystem" window looks like this (`entities/actor` directories are really not necessary):
+Create the necessary directories to hold the respective assets and it's just a matter of dragging and dropping, I used directories: `res://entities/actors/player/sprites/`, `res://fonts/`, `res://levels/world/background/sprites/`, `res://levels/world/ground/sprites/`, `res://levels/world/pipe/sprites/`, `res://sfx/`. For the player sprites, the
+*FileSystem* window looks like this (`entities/actor` directories are really not necessary):
-![FileSystem - Player sprite imports](images/g/flappybird_godot/player_sprite_imports.png "FileSystem - Player sprite imports")
+![FileSystem - Player sprite imports](${SURL}/images/g/flappybird_godot/player_sprite_imports.png "FileSystem - Player sprite imports")
It should look similar for other directories, except maybe for the file extensions. For example, for the sfx:
-![FileSystem - SFX imports](images/g/flappybird_godot/sfx_imports.png "FileSystem - SFX imports")
+![FileSystem - SFX imports](${SURL}/images/g/flappybird_godot/sfx_imports.png "FileSystem - SFX imports")
-## Scenes
+# Scenes
Now it's time to actually create the game, by creating the basic scenes that will make up the game. The hardest part and the most confusing is going to be the *TileMaps*, so that goes first.
-### TileMaps
+## TileMaps
-I'm using a scene called "WorldTiles" with a *Node2D* node as root called the same. With 2 different *TileMap* nodes as children named "GroundTileMap" and "PipeTileMap" (these are their own scene); yes 2 different *TileMaps* because we need 2 different physics colliders (In Godot 4.0 you can have a single *TileMap* with different physics colliders in it). Each node has its own script. It should look something like this:
+I'm using a scene called `WorldTiles` with a *Node2D* node as root called the same. With 2 different *TileMap* nodes as children named `GroundTileMap` and `PipeTileMap` (these are their own scene); yes 2 different *TileMaps* because we need 2 different physics colliders (in *Godot 4.0* you can have a single *TileMap* with different physics colliders in it). Each node has its own script. It should look something like this:
-![Scene - WorldTiles (TileMaps)](images/g/flappybird_godot/scene_world_tiles.png "Scene - WorldTiles (TileMaps)")
+![Scene - WorldTiles (TileMaps)](${SURL}/images/g/flappybird_godot/scene_world_tiles.png "Scene - WorldTiles (TileMaps)")
I used the following directory structure:
-![Scene - WorldTiles - Directory structure](images/g/flappybird_godot/scene_world_tiles_directory_structure.png "Scene - WorldTiles - Directory structure")
+![Scene - WorldTiles - Directory structure](${SURL}/images/g/flappybird_godot/scene_world_tiles_directory_structure.png "Scene - WorldTiles - Directory structure")
-To configure the GroundTileMap, select the node and click on "(empty)" on the *TileMap/Tile set* property and then click on "New TileSet", then click where the "(empty)" used to be, a new window should open on the bottom:
+To configure the `GroundTileMap`, select the node and click on `(empty)` on the *TileMap/Tile set* property and then click on `New TileSet`, then click where the `(empty)` used to be, a new window should open on the bottom:
-![TileSet - Configuration window](images/g/flappybird_godot/tile_set_config_window.png "TileSet - Configuration window")
+![TileSet - Configuration window](${SURL}/images/g/flappybird_godot/tile_set_config_window.png "TileSet - Configuration window")
-Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow "+ New Single Tile", activate the grid and select any of the tiles. Should look like this:
+Click on the plus on the bottom left and you can now select the specific tile set to use. Now click on the yellow `+ New Single Tile`, activate the grid and select any of the tiles. Should look like this:
-![TileSet - New single tile](images/g/flappybird_godot/tile_set_new_single_tile.png "TileSet - New single tile")
+![TileSet - New single tile](${SURL}/images/g/flappybird_godot/tile_set_new_single_tile.png "TileSet - New single tile")
-We need to do this because for some reason we can't change the snap options before selecting a tile. After selecting a random tile, set up the *Snap Options/Step* (in the *Inspector*) and set it to 16x16 (or if using a different tile set, to it's tile size):
+We need to do this because for some reason we can't change the snap options before selecting a tile. After selecting a random tile, set up the *Snap Options/Step* (in the *Inspector*) and set it to `16x16` (or if using a different tile set, to it's tile size):
-![TileSet - Tile - Step snap options](images/g/flappybird_godot/tile_set_tile_step_snap_options.png "TileSet - Tile - Step snap options")
+![TileSet - Tile - Step snap options](${SURL}/images/g/flappybird_godot/tile_set_tile_step_snap_options.png "TileSet - Tile - Step snap options")
-Now you can select the actual single tile. Once selected click on "Collision", use the rectangle tool and draw the rectangle corresponding to that tile's collision:
+Now you can select the actual single tile. Once selected click on `Collision`, use the rectangle tool and draw the rectangle corresponding to that tile's collision:
-![TileSet - Tile - Selection and collision](images/g/flappybird_godot/tile_set_tile_selection_collision.png "TileSet - Tile - Selection and collision")
+![TileSet - Tile - Selection and collision](${SURL}/images/g/flappybird_godot/tile_set_tile_selection_collision.png "TileSet - Tile - Selection and collision")
Do the same for the other 3 tiles. If you select the *TileMap* itself again, it should look like this on the right (on default layout it's on the left of the *Inspector*):
-![TileSet - Available tiles](images/g/flappybird_godot/tile_set_available_tiles.png "TileSet - Available tiles")
+![TileSet - Available tiles](${SURL}/images/g/flappybird_godot/tile_set_available_tiles.png "TileSet - Available tiles")
The ordering is important only for the "underground tile", which is the filler ground, it should be at the end (index 3); if this is not the case, repeat the process (it's possible to rearrange them but it's hard to explain as it's pretty weird).
-At this point the tilemap doesn't have any physics and the cell size is wrong. Select the "GroundTileMap", set the *TileMap/Cell/Size* to 16x16, the *TileMap/Collision/Layer* set to `bit 2` only (ground layer) and disable any *TileMap/Collision/Mask* bits. Should look something like this:
+At this point the tilemap doesn't have any physics and the cell size is wrong. Select the `GroundTileMap`, set the *TileMap/Cell/Size* to `16x16`, the *TileMap/Collision/Layer* set to `bit 2` only (ground layer) and disable any *TileMap/Collision/Mask* bits. Should look something like this:
-![TileMap - Cell size and collision configuration](images/g/flappybird_godot/tile_map_cell_collision_configuration.png "TileMap - Cell size and collision configuration")
+![TileMap - Cell size and collision configuration](${SURL}/images/g/flappybird_godot/tile_map_cell_collision_configuration.png "TileMap - Cell size and collision configuration")
-Now it's just a matter of repeating the same for the pipes ("PipeTileMap"), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the *Snap Options/Step* to 32x16, for example, just keep the cell size to 16x16.
+Now it's just a matter of repeating the same for the pipes (`PipeTileMap`), only difference is that when selecting the tiles you need to select 2 tiles, as the pipe is 2 tiles wide, or just set the *Snap Options/Step* to `32x16`, for example, just keep the cell size to `16x16`.
-#### Default ground tiles
+### Default ground tiles
-I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the "WorldTiles" scene, while selecting the "GroundTileMap", you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from `(-8, 7)` to `(10, 7)` as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):
+I added few default ground tiles to the scene, just for testing purposes but I left them there. These could be place programatically, but I was too lazy to change things. On the `WorldTiles` scene, while selecting the `GroundTileMap`, you can select the tiles you want to paint with, and left click in the grid to paint with the selected tile. Need to place tiles from `(-8, 7)` to `(10, 7)` as well as the tile below with the filler ground (the tile position/coordinates show at the bottom left, refer to the image below):
-![Scene - WorldTiles - Default ground tiles](images/g/flappybird_godot/world_tiles_default_tiles.png "Scene - WorldTiles - Default ground tiles")
+![Scene - WorldTiles - Default ground tiles](${SURL}/images/g/flappybird_godot/world_tiles_default_tiles.png "Scene - WorldTiles - Default ground tiles")
-### Player
+## Player
-On a new scene called "Player" with a *KinematicBody2D* node named "Player" as the root of the scene, then for the children: *AnimatedSprite* as "Sprite", *CollisionShape2D* as "Collision" (with a circle shape) and 3 *AudioStreamPlayers* for "JumpSound", "DeadSound" and "HitSound". Not sure if it's a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the "Player" node and then it should look like this:
+On a new scene called `Player` with a *KinematicBody2D* node named `Player` as the root of the scene, then for the children: *AnimatedSprite* as `Sprite`, *CollisionShape2D* as `Collision` (with a circle shape) and 3 *AudioStreamPlayers* for `JumpSound`, `DeadSound` and `HitSound`. Not sure if it's a good practice to have the audio here, since I did that at the end, pretty lazy. Then, attach a script to the `Player` node and then it should look like this:
-![Scene - Player - Node setup](images/g/flappybird_godot/scene_player_node_setup.png "Scene - Player - Node setup")
+![Scene - Player - Node setup](${SURL}/images/g/flappybird_godot/scene_player_node_setup.png "Scene - Player - Node setup")
-Select the "Player" node and set the *CollisionShape2D/Collision/Layer* to 1 and the *CollisionObject2D/Collision/Mask* to 2 and 3 (ground and pipe).
+Select the `Player` node and set the *CollisionShape2D/Collision/Layer* to `1` and the *CollisionObject2D/Collision/Mask* to `2` and `3` (ground and pipe).
-For the "Sprite" node, when selecting it click on the "(empty)" for the *AnimatedSprite/Frames* property and click "New SpriteFrames", click again where the "(empty)" used to be and ane window should open on the bottom:
+For the `Sprite` node, when selecting it click on the `(empty)` for the *AnimatedSprite/Frames* property and click `New SpriteFrames`, click again where the `(empty)` used to be and ane window should open on the bottom:
-![Scene - Player - SpriteFrames window](images/g/flappybird_godot/scene_player_spriteframes_window.png "Scene - Player - SpriteFrames window")
+![Scene - Player - SpriteFrames window](${SURL}/images/g/flappybird_godot/scene_player_spriteframes_window.png "Scene - Player - SpriteFrames window")
-Right off the bat, set the "Speed" to `10 FPS` (bottom left) and rename "default" to "bird_1". With the "bird_1" selected, click on the "Add frames from a Sprite Sheet", which is the second button under "Animation Frames:" which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the "Select Frames" window, change the "Vertical" to 1, and then select all 4 frames (*Ctrl + Scroll* wheel to zoom in):
+Right off the bat, set the `Speed` to `10 FPS` (bottom left) and rename `default` to `bird_1`. With the `bird_1` selected, click on the `Add frames from a Sprite Sheet`, which is the second button under `Animation Frames:` which looks has an icon of a small grid (next to the folder icon), a new window will popup where you need to select the respective sprite sheet to use and configure it for importing. On the `Select Frames` window, change the `Vertical` to `1`, and then select all 4 frames (*Ctrl + Scroll* wheel to zoom in):
-![Scene - Player - Sprite sheet importer](images/g/flappybird_godot/scene_player_sprite_sheet_importer.png "Scene - Player - Sprite sheet importer")
+![Scene - Player - Sprite sheet importer](${SURL}/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png "Scene - Player - Sprite sheet importer")
After that, the *SpriteFrames* window should look like this:
-![Scene - Player - SpriteFrames window with sprite sheet configured](images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png "Scene - Player - SpriteFrames window with sprite sheet configured")
+![Scene - Player - SpriteFrames window with sprite sheet configured](${SURL}/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png "Scene - Player - SpriteFrames window with sprite sheet configured")
-Finally, make sure the "Sprite" node has the *AnimatedSprite/Animation* is set to "bird_1" and that the "Collision" node is configured correctly for its size and position (I just have it as a radius of 7). As well as dropping the SFX files into the corresponding *AudioStreamPlayer* (into the *AudioStreamPlayer/Stream* property).
+Finally, make sure the `Sprite` node has the *AnimatedSprite/Animation* is set to `bird_1` and that the `Collision` node is configured correctly for its size and position (I just have it as a radius of `7`). As well as dropping the SFX files into the corresponding *AudioStreamPlayer* (into the *AudioStreamPlayer/Stream* property).
-### Other
+## Other
These are really simple scenes that don't require much setup:
-- "CeilingDetector": just an *Area2D* node with a *CollisionShape2D* in the form of a rectangle (*CollisionShape2D/Shape/extents* to `(120, 10)`), stretched horizontally so it fits the whole screen. *CollisionObject2D/Collision/Layer* set to `bit 4` (ceiling) and *CollisionObject2D/Collision/Mask* set to bit 1 (player).
-- "ScoreDetector": similar to the "CeilingDetector", but vertical (*CollisionShape2D/Shape/extents* to `(2.5, 128)`) and *CollisionObject2D/Collision/Layer* set to `bit 1` (player).
-- "WorldDetector": *Node2D* with a script attached, and 3 *RayCast2D* as children:
- - "NewTile": *Raycast2D/Enabled* to true (checked), *Raycast2D/Cast To* `(0, 400)`, *Raycast2D/Collision Mask* to `bit 2` (ground) and *Node2D/Transform/Position* to `(152, -200)`
- - "OldTile": same as "NewTile", except for the *Node2D/Transform/Position*, set it to `(-152, -200)`.
- - "OldPipe": same as "OldTile", except for the *Raycast2D/Collision Mask*, set it to `bit 3` (pipe).
+- `CeilingDetector`: just an *Area2D* node with a *CollisionShape2D* in the form of a rectangle (*CollisionShape2D/Shape/extents* to `(120, 10)`), stretched horizontally so it fits the whole screen. *CollisionObject2D/Collision/Layer* set to `bit 4` (ceiling) and *CollisionObject2D/Collision/Mask* set to `bit 1` (player).
+- `ScoreDetector`: similar to the `CeilingDetector`, but vertical (*CollisionShape2D/Shape/extents* to `(2.5, 128)`) and *CollisionObject2D/Collision/Layer* set to `bit 1` (player).
+- `WorldDetector`: *Node2D* with a script attached, and 3 *RayCast2D* as children:
+ - `NewTile`: *Raycast2D/Enabled* to true (checked), *Raycast2D/Cast To* `(0, 400)`, *Raycast2D/Collision Mask* to `bit 2` (ground) and *Node2D/Transform/Position* to `(152, -200)`
+ - `OldTile`: same as "NewTile", except for the *Node2D/Transform/Position*, set it to `(-152, -200)`.
+ - `OldPipe`: same as "OldTile", except for the *Raycast2D/Collision Mask*, set it to `bit 3` (pipe).
-### Game
+## Game
-This is the actual "Game" scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a *Node2D* and also has an attached script. Also need to add 2 additional *AudioStreamPlayers* for the "start" and "score" sounds, as well as a *Sprite* for the background (*Sprite/Offset/Offset* set to `(0, 10)`) and a *Camera2D* (*Camera2D/Current* set to true (checked)). It should look something like this:
+This is the actual `Game` scene that holds all the playable stuff, here we will drop in all the previous scenes; the root node is a *Node2D* and also has an attached script. Also need to add 2 additional *AudioStreamPlayers* for the "start" and "score" sounds, as well as a *Sprite* for the background (*Sprite/Offset/Offset* set to `(0, 10)`) and a *Camera2D* (*Camera2D/Current* set to true (checked)). It should look something like this:
-![Scene - Game - Node setup](images/g/flappybird_godot/scene_game_node_setup.png "Scene - Game - Node setup")
+![Scene - Game - Node setup](${SURL}/images/g/flappybird_godot/scene_game_node_setup.png "Scene - Game - Node setup")
The scene viewport should look something like the following:
-![Scene - Game - Viewport](images/g/flappybird_godot/scene_game_viewport.png "Scene - Game - Viewport")
+![Scene - Game - Viewport](${SURL}/images/g/flappybird_godot/scene_game_viewport.png "Scene - Game - Viewport")
-### UI
+## UI
-#### Fonts
+### Fonts
-We need some font "Resources" to style the *Label* fonts. Under the *FileSystem* window, right click on the fonts directory (create one if needed) and click on "New Resource..." and select *DynamicFontData*, save it in the "fonts" directory as "SilverDynamicFontData.tres" ("Silver" as it is the font I'm using) then double click the just created resource and set the *DynamicFontData/Font Path* to the actual "Silver.ttf" font (or whatever you want).
+We need some font `Resources` to style the *Label* fonts. Under the *FileSystem* window, right click on the fonts directory (create one if needed) and click on `New Resource...` and select *DynamicFontData*, save it in the "fonts" directory as `SilverDynamicFontData.tres` (`Silver` as it is the font I'm using) then double click the just created resource and set the *DynamicFontData/Font Path* to the actual `Silver.ttf` font (or whatever you want).
-Then create a new resource and this time select *DynamicFont*, name it "SilverDynamicFont.tres", then double click to edit and add the "SilverDynamicFontData.tres" to the *DynamicFont/Font/Font Data* property (and I personally toggled off the *DynamicFont/Font/Antialiased* property), now just set the *DynamicFont/Settings/(Size, Outline Size, Outline Color)* to 32, 1 and black, respectively (or any other values you want). It should look something like this:
+Then create a new resource and this time select *DynamicFont*, name it `SilverDynamicFont.tres`, then double click to edit and add the `SilverDynamicFontData.tres` to the *DynamicFont/Font/Font Data* property (and I personally toggled off the *DynamicFont/Font/Antialiased* property), now just set the *DynamicFont/Settings/(Size, Outline Size, Outline Color)* to `32`, `1` and `black`, respectively (or any other values you want). It should look something like this:
-![Resource - DynamicFont - Default font](images/g/flappybird_godot/resource_dynamic_font.png "Resource - DynamicFont - Default font")
+![Resource - DynamicFont - Default font](${SURL}/images/g/flappybird_godot/resource_dynamic_font.png "Resource - DynamicFont - Default font")
-Do the same for another *DynamicFont* which will be used for the score label, named "SilverScoreDynamicFont.tres". Only changes are *Dynamic/Settings/(Size, Outline Size)* which are set to 128 and 2, respectively. The final files for the fonts should look something like this:
+Do the same for another *DynamicFont* which will be used for the score label, named `SilverScoreDynamicFont.tres`. Only changes are *Dynamic/Settings/(Size, Outline Size)* which are set to `128` and `2`, respectively. The final files for the fonts should look something like this:
-![Resource - Dynamicfont - Directory structure](images/g/flappybird_godot/resource_dynamic_font_directory_structure.png "Resource - Dynamicfont - Directory structure")
+![Resource - Dynamicfont - Directory structure](${SURL}/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png "Resource - Dynamicfont - Directory structure")
-#### Scene setup
+### Scene setup
-This has a bunch of nested nodes, so I'll try to be concise here. The root node is a *CanvasLayer* named "UI" with its own script attached, and for the children:
+This has a bunch of nested nodes, so I'll try to be concise here. The root node is a *CanvasLayer* named `UI` with its own script attached, and for the children:
-- "MarginContainer": *MarginContainer* with *Control/Margin/(Left, Top)* set to `10` and *Control/Margin/(Right, Bottom)* set to `-10`.
- - "InfoContainer": *VBoxContainer* with *Control/Theme Overrides/Constants/Separation* set to `250`.
- - "ScoreContainer": *VBoxContainer*.
- - "Score": *Label* with *Label/Align* set to "Center", *Control/Theme Overrides/Fonts/Font* to the "SilverScoreDynamicFont.tres", if needed adjust the *DynamicFont* settings.
- - "HighScore: same as "Score", escept for the *Control/Theme Overrides/Fonts/Font* which is set to "SilverDynamicFont.tres".
- - "StartGame": Same as "HighScore".
- - "DebugContainer": *VBoxContainer*.
- - "FPS": *Label*.
- - "VersionContainer": *VBoxContainer* with *BoxContainer/Alignment* set to "Begin".
- - "Version": *Label* with *Label/Align* set to "Right".
+- `MarginContainer`: *MarginContainer* with *Control/Margin/(Left, Top)* set to `10` and *Control/Margin/(Right, Bottom)* set to `-10`.
+ - `InfoContainer`: *VBoxContainer* with *Control/Theme Overrides/Constants/Separation* set to `250`.
+ - `ScoreContainer`: *VBoxContainer*.
+ - `Score`: *Label* with *Label/Align* set to `Center`, *Control/Theme Overrides/Fonts/Font* to the `SilverScoreDynamicFont.tres`, if needed adjust the *DynamicFont* settings.
+ - `HighScore`: same as `Score`, escept for the *Control/Theme Overrides/Fonts/Font* which is set to `SilverDynamicFont.tres`.
+ - `StartGame`: Same as `HighScore`.
+ - `DebugContainer`: *VBoxContainer*.
+ - `FPS`: *Label*.
+ - `VersionContainer`: *VBoxContainer* with *BoxContainer/Alignment* set to `Begin`.
+ - `Version`: *Label* with *Label/Align* set to `Right`.
The scene ends up looking like this:
-![Scene - UI - Node setup](images/g/flappybird_godot/scene_ui.png "Scene - UI - Node setup")
+![Scene - UI - Node setup](${SURL}/images/g/flappybird_godot/scene_ui.png "Scene - UI - Node setup")
-### Main
+## Main
-This is the final scene where we connect the Game and the UI. It's made of a *Node2D* with it's own script attached and an instance of "Game" and "UI" as it's children.
+This is the final scene where we connect the `Game` and the `UI`. It's made of a *Node2D* with it's own script attached and an instance of `Game` and `UI` as it's children.
-This is a good time to set the default scene when we run the game by going to *Project -> Project settings... -> General* and in *Application/Run* set the *Main Scene* to the "Main.tscn" scene.
+This is a good time to set the default scene when we run the game by going to *Project -> Project settings... -> General* and in *Application/Run* set the *Main Scene* to the `Main.tscn` scene.
-## Scripting
+# Scripting
I'm going to keep this scripting part to the most basic code blocks, as it's too much code, for a complete view you can head to the [source code](https://github.com/luevano/flappybird_godot).
As of now, the game itself doesn't do anything if we hit play. The first thing to do so we have something going on is to do the minimal player scripting.
-### Player
+## Player
-The most basic code needed so the bird goes up and down is to just detect "jump" key presses and add a negative jump velocity so it goes up (`y` coordinate is reversed in godot...), we also check the velocity sign of the `y` coordinate to decide if the animation is playing or not.
+The most basic code needed so the bird goes up and down is to just detect `jump` key presses and add a negative jump velocity so it goes up (`y` coordinate is reversed in godot...), we also check the velocity sign of the `y` coordinate to decide if the animation is playing or not.
```gdscript
class_name Player
@@ -275,7 +281,7 @@ func _emit_player_died() -> void:
Finally need to add the actual checks for when the player dies (like collision with ground or pipe) as well as a function that listens to a signal for when the player goes to the ceiling.
-### WorldDetector
+## WorldDetector
The code is pretty simple, we just need a way of detecting if we ran out of ground and send a signal, as well as sending as signal when we start detecting ground/pipes behind us (to remove it) because the world is being generated as we move. The most basic functions needed are:
@@ -299,9 +305,9 @@ func _now_colliding(detector: RayCast2D, flag: bool, signal_name: String) -> boo
We need to keep track of 3 "flags": `ground_was_colliding`, `ground_now_colliding` and `pipe_now_colliding` (and their respective signals), which are going to be used to do the checks inside `_physics_process`. For example for checking for new ground: `ground_now_colliding = _now_colliding(old_ground, ground_now_colliding, "ground_started_colliding")`.
-### WorldTiles
+## WorldTiles
-This script is what handles the "GroundTileMap" as well as the "PipeTileMap" and just basically functions as a "Signal bus" connecting a bunch of signals from the "WorldDetector" with the *TileMaps* and just tracking how many pipes have been placed:
+This script is what handles the `GroundTileMap` as well as the `PipeTileMap` and just basically functions as a "Signal bus" connecting a bunch of signals from the `WorldDetector` with the *TileMaps* and just tracking how many pipes have been placed:
```gdscript
export(int, 2, 20, 2) var PIPE_SEP: int = 6
@@ -325,7 +331,7 @@ func _on_WorldDetector_pipe_started_colliding() -> void:
emit_signal("remove_pipe")
```
-#### GroundTileMap
+### GroundTileMap
This is the node that actually places the ground tiles upong receiving a signal. In general, what you want is to keep track of the newest tile that you need to place (empty spot) as well as the last tile that is in the tilemap (technically the first one if you count from left to right). I was experimenting with `enum`s so I used them to define the possible `Ground` tiles:
@@ -364,11 +370,11 @@ func _remove_first_ground() -> void:
Where you might notice that the `_initial_new_tile_x` is `11`, instead of `10`, refer to [Default ground tiles](#default-ground-tiles) where we placed tiles from `-8` to `10`, so the next empty one is `11`. These `_place_new_ground` and `_remove_first_ground` functions are called upon receiving the signal.
-#### PipeTileMap
+### PipeTileMap
-This is really similar to the "GroundTileMap" code, instead of defining an `enum` for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):
+This is really similar to the `GroundTileMap` code, instead of defining an `enum` for the ground tiles, we define it for the pipe patterns (because each pipe is composed of multiple pipe tiles). If your pipe tile set looks like this (notice the index):
-![PipeTileMap - Tile set indexes](images/g/flappybird_godot/tile_set_pipes_indexes.png "PipeTileMap - Tile set indexes")
+![PipeTileMap - Tile set indexes](${SURL}/images/g/flappybird_godot/tile_set_pipes_indexes.png "PipeTileMap - Tile set indexes")
Then you can use the following "pipe patterns":
@@ -383,7 +389,7 @@ var pipe: Dictionary = {
}
```
-Now, the pipe system requires a bit more of tracking as we need to instantiate a "ScoreDetector" here, too. I ended up keeping track of the placed pipes/detectors by using a "pipe stack" (and "detector stack") which is just an array of placed objects from which I pop the first when deleting them:
+Now, the pipe system requires a bit more of tracking as we need to instantiate a `ScoreDetector` here, too. I ended up keeping track of the placed pipes/detectors by using a "pipe stack" (and "detector stack") which is just an array of placed objects from which I pop the first when deleting them:
```gdscript
onready var _pipe_sep: int = get_parent().PIPE_SEP
@@ -402,7 +408,7 @@ var detector_offset: Vector2 = Vector2(16.0, -(_pipe_size / 2.0) * 16.0)
var detector_stack: Array
```
-The `detector_offset` is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new "ScoreDetector" (`detector_scene`) and set it's position to the pipe starting position plus the offset, so it's centered in the pipe, then just need to connect the "body_entered" signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:
+The `detector_offset` is just me being picky. For placing a new pipe, we get the starting position (bottom pipe tile) and build upwards, then instantiate a new `ScoreDetector` (`detector_scene`) and set it's position to the pipe starting position plus the offset, so it's centered in the pipe, then just need to connect the `body_entered` signal from the detector with the game, so we keep track of the scoring. Finally just add the placed pipe and detector to their corresponding stacks:
```gdscript
func _place_new_pipe() -> void:
@@ -439,9 +445,9 @@ func _remove_old_pipe() -> void:
These functions are called when receiving the signal to place/remove pipes.
-### Saved data
+## Saved data
-Before proceeding, we require a way to save/load data (for the high scores). We're going to use the *ConfigFile* node that uses a custom version of the "ini" file format. Need to define where to save the data:
+Before proceeding, we require a way to save/load data (for the high scores). We're going to use the *ConfigFile* node that uses a custom version of the `ini` file format. Need to define where to save the data:
```gdscript
const DATA_PATH: String = "user://data.cfg"
@@ -496,11 +502,11 @@ func _ready() -> void:
save_data()
```
-Now, this script in particular will need to be a [Singleton (AutoLoad)](https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html), which means that there will be only one instance and will be available across all scripts. To do so, go to *Project -> Project settings... -> AutoLoad* and select this script in the "Path:" and add a "Node Name:" (I used "SavedData", if you use something else, be careful while following this devlog) which will be the name we'll use to access the singleton. Toggle on "Enable" if needed, it should look like this:
+Now, this script in particular will need to be a [Singleton (AutoLoad)](https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html), which means that there will be only one instance and will be available across all scripts. To do so, go to *Project -> Project settings... -> AutoLoad* and select this script in the `Path:` and add a `Node Name:` (I used `SavedData`, if you use something else, be careful while following this devlog) which will be the name we'll use to access the singleton. Toggle on `Enable` if needed, it should look like this:
-![Project settings - AutoLoad - SavedData singleton](images/g/flappybird_godot/project_settings_autoload_saved_data.png "Project settings - AutoLoad - SavedData singleton")
+![Project settings - AutoLoad - SavedData singleton](${SURL}/images/g/flappybird_godot/project_settings_autoload_saved_data.png "Project settings - AutoLoad - SavedData singleton")
-### Game
+## Game
The game script it's also like a "Signal bus" in the sense that it connects all its childs' signals together, and also has the job of starting/stopping the `_process` and `_physics_process` methods from the childs as needed. First, we need to define the signals and and references to all child nodes:
@@ -519,7 +525,7 @@ onready var start_sound: AudioStreamPlayer = $StartSound
onready var score_sound: AudioStreamPlayer = $ScoreSound
```
-It's important to get the actual "player speed", as we're using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the "game_scale" we setup at the beginning and compute the `player_speed`:
+It's important to get the actual "player speed", as we're using a scale to make the game look bigger (remember, pixel art), to do so we need a reference to the `game_scale` we setup at the beginning and compute the `player_speed`:
```gdscript
var _game_scale: float = ProjectSettings.get_setting("application/config/game_scale")
@@ -532,7 +538,7 @@ func _ready() -> void:
player_speed = player.SPEED / _game_scale
```
-This `player_speed` will be needed as we need to move all the nodes ("Background", "Camera", etc.) in the `x` axis as the player is moving. This is done in the `_physics_process`:
+This `player_speed` will be needed as we need to move all the nodes (`Background`, `Camera`, etc.) in the `x` axis as the player is moving. This is done in the `_physics_process`:
```gdscript
func _physics_process(delta: float) -> void:
@@ -589,9 +595,9 @@ func _on_ScoreDetector_body_entered(body: Node2D) -> void:
score_sound.play()
```
-When the `player` dies, we set all processing to `false`, except for the player itself (so it can drop all the way to the ground). Also, when receiving a "scoring" signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the `high_score` at the beginning by calling `SavedData.get_high_score()`. This signal we emit will be received by the UI so it updates accordingly.
+When the `player` dies, we set all processing to `false`, except for the player itself (so it can drop all the way to the ground). Also, when receiving a "scoring" signal, we manage the current score, as well as saving the new high score when applicable, note that we need to read the `high_score` at the beginning by calling `SavedData.get_high_score()`. This signal we emit will be received by the `UI` so it updates accordingly.
-### UI
+## UI
First thing is to get a reference to all the child *Labels*, an initial reference to the high score as well as the version defined in the project settings:
@@ -648,9 +654,9 @@ func _on_Game_new_score(score: int, high_score: int) -> void:
high_score_label.set_text("High score: %s" % high_score)
```
-### Main
+## Main
-This is the shortest script, it just connects the signals between the "Game" and the "UI":
+This is the shortest script, it just connects the signals between the `Game` and the `UI`:
```gdscript
onready var game: Game = $Game
@@ -665,20 +671,20 @@ func _ready() -> void:
game.connect("new_score", ui, "_on_Game_new_score")
```
-## Final notes and exporting
+# Final notes and exporting
At this point the game should be fully playable (if any detail missing feel free to look into the source code linked at the beginning). Only thing missing is an icon for the game; I did one pretty quicly with the assets I had.
-### Preparing the files
+## Preparing the files
If you followed the directory structure I used, then only thing needed is to transform the icon to a native Windows `ico` format (if exporting to Windows, else ignore this part). For this you need [ImageMagick](https://imagemagick.org/index.php) or some other program that can transform `png` (or whatever file format you used for the icon) to `ico`. I used [Chocolatey][https://chocolatey.org/] to install `imagemagick`, then to convert the icon itself used: `magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico` as detailed in *Godot*'s [Changing application icon for Windows](https://docs.godotengine.org/en/stable/tutorials/export/changing_application_icon_for_windows.html).
-### Exporting
+## Exporting
-You need to download the templates for exporting as detailed in *Godot*'s [Exporting projects](https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html). Basically you go to *Editor -> Manage Export Templates...* and download the latest one specific to your *Godot* version by clicking on "Download and Install".
+You need to download the templates for exporting as detailed in *Godot*'s [Exporting projects](https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html). Basically you go to *Editor -> Manage Export Templates...* and download the latest one specific to your *Godot* version by clicking on `Download and Install`.
If exporting for Windows then you also need to download `rcedit` from [here](https://github.com/electron/rcedit/releases/latest). Just place it wherever you want (I put it next to the *Godot* executable).
-Then go to *Project -> Export...* and the Window should be empty, add a new template by clicking on "Add..." at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the "Export Path" for each template, which is te location of where the executable will be written to, and in the case of the Windows Desktop template you could also setup stuff like "Company Name", "Product Name", "File/Product Version", etc..
+Then go to *Project -> Export...* and the Window should be empty, add a new template by clicking on `Add...` at the top and then select the template you want. I used HTML5, Windows Desktop and Linux/X11. Really the only thing you need to set is the "Export Path" for each template, which is te location of where the executable will be written to, and in the case of the *Windows Desktop* template you could also setup stuff like `Company Name`, `Product Name`, `File/Product Version`, etc..
-Once the templates are setup, select any and click on "Export Project" at the bottom, and make sure to untoggle "Export With Debug" in the window that pops up, this checkbox should be at the bottom of the new window.
+Once the templates are setup, select any and click on `Export Project` at the bottom, and make sure to untoggle `Export With Debug` in the window that pops up, this checkbox should be at the bottom of the new window.
diff --git a/src/blog/g/godot_project_structure.md b/src/blog/g/godot_project_structure.md
index 3f013cc..b826516 100644
--- a/src/blog/g/godot_project_structure.md
+++ b/src/blog/g/godot_project_structure.md
@@ -3,6 +3,7 @@ author: David Luévano
lang: en
summary: Details on the project structure I'm using for Godot, based on preference and some research I did.
tags: gamedev
+ godot
short
english
diff --git a/src/blog/g/gogodot_jam3_devlog_1.md b/src/blog/g/gogodot_jam3_devlog_1.md
index 9e836b1..749356b 100644
--- a/src/blog/g/gogodot_jam3_devlog_1.md
+++ b/src/blog/g/gogodot_jam3_devlog_1.md
@@ -4,47 +4,52 @@ lang: en
summary: Details on the implementation for the game I created for the Go Godot Jam 3, which theme is Evolution.
tags: gamedev
godot
+ gdscript
gamejam
english
-The jam's theme is Evolution and all the details are listed [here](https://itch.io/jam/go-godot-jam-3). ~~This time I'm logging as I go, so there might be some changes to the script or scenes along the way~~ ^^I couldn't actually do this, as I was running out of time.^^. Note that I'm not going to go into much details, the obvious will be ommitted.
+The jam's theme is Evolution and all the details are listed [here](https://itch.io/jam/go-godot-jam-3). ~~This time I'm logging as I go, so there might be some changes to the script or scenes along the way.~~ ^^I couldn't actually do this, as I was running out of time^^. Note that I'm not going to go into much details, the obvious will be ommitted.
I wanted to do a *Snake* clone, and I'm using this jam as an excuse to do it and add something to it. The features include:
- Snakes will pass their stats in some form to the next snakes.
- Non-grid snake movement. I just hate the grid constraint, so I wanted to make it move in any direction.
-- Depending on the food you eat, you'll gain new mutations/abilities ~~and the more you eat the more that mutation develops.~~ ^^didn't have time to add this feature, sad.^^
+- Depending on the food you eat, you'll gain new mutations/abilities ~~and the more you eat the more that mutation develops~~ ^^didn't have time to add this feature, sad^^.
- Procedural map creation.
-I created this game using *Godot 3.5-rc3*. You can find the source code in my GitHub [here](https://github.com/luevano/gogodot_jam3) which at the time of writing this it doesn't contain any exported files, for that you can go ahead and play it in your browser at itch.io, which you can find below:
+I created this game using *Godot 3.5-rc3*. You can find the source code in my GitHub [here](https://github.com/luevano/gogodot_jam3) which at the time of writing this it doesn't contain any exported files, for that you can go ahead and play it in your browser at [itch.io](https://lorentzeus.itch.io/snake-tronic), which you can find below:
-<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="552" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
+<p style="text-align:center"><iframe src="https://itch.io/embed/1562701?dark=true" width="208" height="167" frameborder="0"><a href="https://lorentzeus.itch.io/snake-tronic">Snake-tronic by Lorentzeus</a></iframe></p>
You can also find the jam entry [here](https://itch.io/jam/go-godot-jam-3/rate/1562701).
Similarly with the my FlappyBird clone, I plan to update this to a better state.
-## Initial setup
+# Table of contents
-Again, similar to the [FlappyBird](https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html) clone I developed, I'm using the directory structure I wrote about on [Godot project structure](https://blog.luevano.xyz/g/godot_project_structure.html) with slight modifications to test things out. Also using similar *Project settings* as those from the *FlappyBird* clone like the pixel art texture imports, keybindings, layers, etc..
+[TOC]
-I've also setup [GifMaker](https://github.com/bram-dingelstad/godot-gifmaker), with slight modifications as the *AssetLib* doesn't install it correctly and contains unnecessry stuff: moved necessary files to the `res://addons` directory, deleted test scenes and files in general, and copied the license to the `res://docs` directory. Setting this up was a bit annoying because the tutorial it's bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn't find it anywhere other than by inspecting some of the code/scenes.^^I ended up not leaving this enabled in the game as it lagged the game out, but it's an option I'll end up researching more.^^
+# Initial setup
+
+Again, similar to the [FlappyBird](https://blog.luevano.xyz/g/flappybird_godot_devlog_1.html) clone I created, I'm using the directory structure I wrote about on [Godot project structure](https://blog.luevano.xyz/g/godot_project_structure.html) with slight modifications to test things out. Also using similar *Project settings* as those from the *FlappyBird* clone like the pixel art texture imports, keybindings, layers, etc..
+
+I've also setup [GifMaker](https://github.com/bram-dingelstad/godot-gifmaker), with slight modifications as the *AssetLib* doesn't install it correctly and contains unnecessry stuff: moved necessary files to the `res://addons` directory, deleted test scenes and files in general, and copied the license to the `res://docs` directory. Setting this up was a bit annoying because the tutorial it's bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn't find it anywhere other than by inspecting some of the code/scenes. ^^I ended up leaving this disabled in the game as it hit the performance by a lot, but it's an option I'll end up researching more^^.
This time I'm also going to be using an [Event bus](https://www.gdquest.com/docs/guidelines/best-practices/godot-gdscript/event-bus/) singleton (which I'm going to just call *Event*) as managing signals was pretty annoying on my last project; as well as a *Global* singleton for essential stuff so I don't have to do as many cross references between nodes/scenes.
-## Assets
+# Assets
This time I'll be creating my own assets in [Aseprite](https://www.aseprite.org/), wont be that good, but enough to prototype and get things going.
Other than that I used few key sprites from [vryell](https://vryell.itch.io/): [Controller & Keyboard Icons](https://vryell.itch.io/controller-keyboard-icons) and a font from [datagoblin](https://datagoblin.itch.io/): [Monogram](https://datagoblin.itch.io/monogram).
-## The snake
+# The snake
This is the most challenging part in my opinion as making all the body parts follow the head in a user defined path it's kinda hard. I tried with like 4-5 options and the one I'm detailing here is the only one that worked as I wanted for me. This time the directory structure I'm using is the following:
-![FileSystem - Snake dir structure](images/g/gogodot_jam3/file_system_snake_dir_structure.png "FileSystem - Snake dir structure")
+![FileSystem - Snake dir structure](${SURL}/images/g/gogodot_jam3/file_system_snake_dir_structure.png "FileSystem - Snake dir structure")
-### Basic movement
+## Basic movement
The most basic thing is to move the head, this is what we have control of. Create a scene called `Head.tscn` and setup the basic *KinematicBody2D* with it's own *Sprite* and *CollisionShape2D* (I used a small circle for the tip of the head), and set the *Collision Layer/Mask* accordingly, for now just `layer = bit 1`. And all we need to do, is keep moving the snake forwards and be able to rotate left or right. Created a new script called `head.gd` attached to the root (*KinematicBody2D*) and added:
@@ -79,9 +84,9 @@ func _rotate_to(direction: int) -> void:
After tunning all the necessary parameters you should get something like this:
-![Snake - Basic movement (left and right controls)](images/g/gogodot_jam3/snake_basic_movement.gif "Snake - Basic movement (left and right controls)")
+![Snake - Basic movement (left and right controls)](${SURL}/images/g/gogodot_jam3/snake_basic_movement.gif "Snake - Basic movement (left and right controls)")
-### Setting up path following
+## Setting up path following
To move other snake parts by following the snake head the only solution I found was to use the *Path2D* and *PathFollow2D* nodes. *Path2D* basically just handles the curve/path that *PathFollow2D* will use to move its child node; and I say "child node" in singular... as *PathFollow2D* can only handle one damn child, all the other ones will have weird transformations and/or rotations. So, the next thing to do is to setup a way to compute (and draw so we can validate) the snake's path/curve.
@@ -123,9 +128,9 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -> void:
With this, we're now populating the *Path2D* curve points with the position of the snake head. You should be able to see it because of the `_draw` call. If you run it you should see something like this:
-![Snake - Basic movement with path](images/g/gogodot_jam3/snake_basic_movement_with_path.gif "Snake - Basic movement with path")
+![Snake - Basic movement with path](${SURL}/images/g/gogodot_jam3/snake_basic_movement_with_path.gif "Snake - Basic movement with path")
-### Define body parts for the snake
+## Define body parts for the snake
At this point the only thing to do is to add the corresponding next body parts and tail of the snake. To do so, we need a *PathFollow2D* to use the live-generating *Path2D*, the only caveat is that we need one of these per body part/tail (this took me hours to figure out, *thanks documentation*).
@@ -143,7 +148,7 @@ func _physics_process(delta: float) -> void:
And this can be attached to the *Body*'s root node (*PathFollow2D*), no extra setup needed. Repeat the same steps for creating the `Tail.tscn` scene and when attaching the `generic_segment.gd` script just configure the `Type` parameter to `tail` in the GUI (by selecting the node with the script attached and editing in the *Inspector*).
-### Adding body parts
+## Adding body parts
Now it's just a matter of handling when to add new body parts in the `snake.gd` script. For now I've only setup for adding body parts to fulfill the initial length of the snake (this doesn't include the head or tail). The extra code needed is the following:
@@ -176,7 +181,7 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -> void:
Select the *Snake* node and add the *Body* and *Tail* scene to the parameters, respectively. Then when running you should see something like this:
-![Snake - Basic movement with all body parts](images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif "Snake - Basic movement with all body parts")
+![Snake - Basic movement with all body parts](${SURL}/images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif "Snake - Basic movement with all body parts")
Now, we need to handle adding body parts after the snake is complete and already moved for a bit, this will require a queue so we can add part by part in the case that we eat multiple pieces of food in a short period of time. For this we need to add some signals: `snake_adding_new_segment(type)`, `snake_added_new_segment(type)`, `snake_added_initial_segments` and use them when makes sense. Now we need to add the following:
@@ -225,9 +230,9 @@ func _add_segment_to_queue() -> void:
body_segment_queue.append(body_segment_queue.back() + Global.SNAKE_SEGMENT_SIZE)
```
-With everything implemented and connected accordingly then we can add segments on demand (for testing I'm adding with a keystroke), it should look like this:
+With everything implemented and connected accordingly then we can add segments on demand (for testing I'm adding with a key press), it should look like this:
-![Snake - Basic movement with dynamic addition of new segments](images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif "Snake - Basic movement with dynamic addition of new segments")
+![Snake - Basic movement with dynamic addition of new segments](${SURL}/images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif "Snake - Basic movement with dynamic addition of new segments")
For now, this should be enough, I'll add more stuff as needed as I go. Last thing is that after finished testing that the movement felt ok, I just added a way to stop the snake whenever it collides with itself by using the following code (and the signal `snake_segment_body_entered(body)`) in a `main.gd` script that is the entry point for the game:
@@ -242,7 +247,7 @@ func _snake_disabled(on_off: bool) -> void:
Which will stop the snake node and all children.
-### Fix on body segments following head
+## Fix on body segments following head
After a while of testing and developing, I noticed that sometimes the head "detaches" from the body when a lot of rotations happen (moving the snake left or right), because of how imprecise the *Curve2D* is. To do this I just send a signal (`snake_rotated`) whenever the snake rotates and make a small correction (in `generic_segment.gd`):
@@ -253,7 +258,7 @@ func _on_snake_rotated() -> void:
This is completely random, I tweaked it manually after a lot of iterations.
-## The food
+# The food
For now I just decided to setup a simple system to see everything works fine. The idea is to make some kind of generic food node/scene and a "food manager" to spawn them, for now in totally random locations. For this I added the following signals: `food_placing_new_food(type)`, `food_placed_new_food(type)` and `food_eaten(type)`.
@@ -310,17 +315,17 @@ func _place_new_food() -> void:
And this is used in `_process` to place new food whenever needed. For now I added a condition to add food until 10 pieces are in place, and keep adding whenever the food is is lower than 10. After setting everything up, this is the result:
-![Snake - Food basic interaction](images/g/gogodot_jam3/snake_food_basic_interaction.gif "Snake - Food basic interaction")
+![Snake - Food basic interaction](${SURL}/images/g/gogodot_jam3/snake_food_basic_interaction.gif "Snake - Food basic interaction")
-## Za warudo! (The world)
+# Za warudo! (The world)
It just happend that I saw a video to create random maps by using a method called [random walks](https://www.mit.edu/~kardar/teaching/projects/chemotaxis(AndreaSchmidt)/random.htm), this video was made by [NAD LABS](https://www.youtube.com/c/NADLABS): [Nuclear Throne Like Map Generation In Godot](https://www.youtube.com/watch?v=ppP2Doq3p7s). It's a pretty simple but powerful script, he provided the source code from which I based my random walker, just tweaked a few things and added others. Some of the maps than can be generated with this method (already aded some random sprites):
-![World map generator - Random map 1](images/g/gogodot_jam3/world_generator_1.png "World map generator - Random map 1")
+![World map generator - Random map 1](${SURL}/images/g/gogodot_jam3/world_generator_1.png "World map generator - Random map 1")
-![World map generator - Random map 2](images/g/gogodot_jam3/world_generator_2.png "World map generator - Random map 2")
+![World map generator - Random map 2](${SURL}/images/g/gogodot_jam3/world_generator_2.png "World map generator - Random map 2")
-![World map generator - Random map 3](images/g/gogodot_jam3/world_generator_3.png "World map generator - Random map 3")
+![World map generator - Random map 3](${SURL}/images/g/gogodot_jam3/world_generator_3.png "World map generator - Random map 3")
It started with just black and white tiles, but I ended up adding some sprites as it was really harsh to the eyes. My implementation is basically the same as *NAD LABS*' with few changes, most importantly: I separated the generation in 2 diferent tilemaps (floor and wall) to have better control as well as wrapped everything in a single scene with a "main" script with the following important functions:
@@ -341,7 +346,7 @@ Where `get_cells_around` is just a function that gets the safe cells around the
Some signals I used for the world gen: `world_gen_walker_started(id)`, `world_gen_walker_finished(id)`, `world_gen_walker_died(id)` and `world_gen_spawn_walker_unit(location)`.
-### Food placement
+## Food placement
The last food algorithm doesn't check anything related to the world, and thus the food could spawn in the walls and outside the map.
@@ -404,13 +409,13 @@ func _get_random_pos() -> Array:
Other than that, there are some differences between placing normal and special food (specially the signal they send, and if an extra "special points" property is set). Some of the signals that I used that might be important: `food_placing_new_food(type)`, `food_placed_new_food(type, location)` and `food_eaten(type, location)`.
-## Stats clas and loading/saving data
+# Stats clas and loading/saving data
-I got the idea of saving the current stats (points, max body segments, etc.) in a separate *Stats* class for easier load/save data. This option I went with didn't work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions... so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving `tres` files).
+I got the idea of saving the current stats (points, max body segments, etc.) in a separate `Stats` class for easier load/save data. This option I went with didn't work as I would liked it to work, as it was a pain in the ass to setup and each time a new property is added you have to manually setup the load/save helper functions... so not the best option. This option I used was json but saving a Node directly could work better or using resources (saving `tres` files).
-### Stats class
+## Stats class
-The *Stats* "class" is just a script that extends from *Node* called `stats.gd`. It needs to define the `class_name` as `Stats`. The main content:
+The `Stats` "class" is just a script that extends from *Node* called `stats.gd`. It needs to define the `class_name` as `Stats`. The main content:
```gdscript
# main
@@ -479,9 +484,9 @@ func set_stats(stats: Dictionary) -> void:
And this is not scalable at all, but I had to do this at the end of the jam so no way of optimizing and/or doing it correctly, sadly.
-### Load/save data
+## Load/save data
-The load/save function is pretty standard. It's a singleton/autoload called *SavedData* with a script that extends from *Node* called `save_data.gd`:
+The load/save function is pretty standard. It's a singleton/autoload called `SavedData` with a script that extends from *Node* called `save_data.gd`:
```gdscript
const DATA_PATH: String = "user://data.save"
@@ -526,11 +531,11 @@ func _handle_new_file() -> void:
file.close()
```
-It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (*Stats* class related issues).
+It uses json as the file format, but I might end up changing this in the future to something else more reliable and easier to use (`Stats` class related issues).
-## Scoring
+# Scoring
-For this I created a scoring mechanisms and just called it *ScoreManager* (`score_manager.gd`) which just basically listens to `food_eaten` signal and adds points accordingly to the current *Stats* object loaded. The main function is:
+For this I created a scoring mechanisms and just called it `ScoreManager` (`score_manager.gd`) which just basically listens to `food_eaten` signal and adds points accordingly to the current *Stats* object loaded. The main function is:
```gdscript
func _on_food_eaten(properties: Dictionary) -> void:
@@ -578,7 +583,7 @@ Which will add the necessary points to `Stats.points` and return the amount of n
Last thing is taht in `_process_points` there is a check at the end, where if the food eaten is "special" then a custom variation of the last 3 functions are executed. These are really similar, just specific to each kind of food.
-This *ScoreManager* also handles the calculation for the `game_over` signal, to calculte progress, set necessary *Stats* values and save the data:
+This `ScoreManager` also handles the calculation for the `game_over` signal, to calculte progress, set necessary `Stats` values and save the data:
```gdscript
func _on_game_over() -> void:
@@ -609,9 +614,9 @@ func _get_max_stats() -> Stats:
Then this sends a signal `display_stats` to activate UI elements that shows the progression.
-Naturally, the saved *Stats* are loaded whenever needed. For example, for the *Snake*, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we're saving the new *Stats* at the end, then on restart we load the updated one.
+Naturally, the saved `Stats` are loaded whenever needed. For example, for the `Snake`, we load the stats and setup any value needed from there (like a flag to know if any ability is enabled), and since we're saving the new `Stats` at the end, then on restart we load the updated one.
-## Snake redesigned with the state machine pattern
+# Snake redesigned with the state machine pattern
I redesigned the snake code (the head, actually) to use the state machine pattern by following [this guide](https://gdscript.com/solutions/godot-state-machine/) which is definitely a great guide, straight to the point and easy to implement.
@@ -638,7 +643,7 @@ func handle_slow_speeds() -> void:
Event.emit_signal("game_over")
```
-And then in the *StateMachine*'s `_process`:
+And then in the `StateMachine`'s `_process`:
```gdscript
func _physics_process(delta: float) -> void:
@@ -702,7 +707,7 @@ Where the important parts happen in the `enter` and `exit` functions. We need to
For the other ones is the same. Only difference with the `jump_state.gd` is that the collision from head to body is disabled, and no rotation is allowed (by not calling the `rotate_on_input` function).
-## Other minor stuff
+# Other minor stuff
Not as important but worth mentioning:
@@ -717,8 +722,8 @@ Not as important but worth mentioning:
- Refactored the nodes to make it work with `change_scene_to`, and added a main menu.
- Added GUI for dead screen, showing the progress.
-## Final notes
+# Final notes
-I actually didn't finish this game (as how I visualized it), but I got it in a playable state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.
+I actually didn't finish this game (as how I visualized it), but I got it in a *semi-playable* state which is good. My big learning during this jam is the time management that it requires to plan and design a game. I lost a lot of time trying to implement some mechanics because I was facing many issues, because of my lack of practice (which was expected) as well as trying to blog and create the necessary sprites myself. Next time I should just get an asset pack and do something with it, as well as keeping the scope of my game shorter.
-For exporting and everything else, I went with what I did for my [FlappyBird Godot clone](https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting) \ No newline at end of file
+For exporting and everything else, I went with what I did for my [FlappyBird Godot clone: final notes and exporting](https://blog.luevano.xyz/g/flappybird_godot_devlog_1#final-notes-and-exporting)
diff --git a/src/blog/g/starting_gamedev_blogging.md b/src/blog/g/starting_gamedev_blogging.md
index 6fc518c..a5c7a37 100644
--- a/src/blog/g/starting_gamedev_blogging.md
+++ b/src/blog/g/starting_gamedev_blogging.md
@@ -3,12 +3,15 @@ author: David Luévano
lang: en
summary: Since I'm starting to get more into gamedev stuff, I'll start blogging about it just to keep consistent.
tags: gamedev
+ godot
update
short
english
-I've been wanting to get into gamedev for a while now, but it's always a pain to stay consistent. I just recently started to get into gamedev again, and this time I'm trying to actually do stuff.
+I've been wanting to get into gamedev for a while now, but it's always a pain to stay consistent. I just recently started to get into it again, and this time I'm trying to actually do stuff.
So, the plan is to blog about my progress and clone some simple games just to get started. I'm thinking on sticking with [Godot](https://godotengine.org/) just because I like that it's open source, it's getting better and better overtime (big rewrite happening right now) and I already like how the engine works. ~~Specifically I'll start using *Godot 4* even though it's not done yet, to get used to the new features, specifically pumped for [GDScript 2.0](https://godotengine.org/article/gdscript-progress-report-feature-complete-40).~~ ^^Actually... (for the small clones/ripoffs) I'll need to use *Godot 3.X* (probably 3.5), as *Godot 4* doesn't have support to export to webassembly (HTML5) yet, and I want that to publish to [itch.io](https://itch.io/) and my website. I'll continue to use *Godot 4* for bigger projects, as they will take longer and I hope that by the time I need to publish, there's no issues to export.^^
-For a moment I almost started a new subdomain just for gamedev stuff, but decided to just use a different directory for subtleness; this directory and use of tags should be enough. I'll be posting the entry about the first rip-off I'm *developing* (FlappyBird L O L) shortly. \ No newline at end of file
+For a moment I almost started a new subdomain just for gamedev stuff, but decided to just use a different directory for subtleness; this directory and use of tags should be enough. I'll be posting the entry about the first rip-off I'm *developing* (FlappyBird L O L) shortly.
+
+**Update**: [Godot 4](https://godotengine.org/article/godot-4-0-sets-sail/) already released and it now has HTML5 support, so back to the original plan.