add snakego

This commit is contained in:
2026-09-08 01:58:47 +02:00
parent c994bf283a
commit c0a8763e45
30 changed files with 39 additions and 14 deletions
+26
View File
@@ -0,0 +1,26 @@
+++
title = "Snake in go"
date = 2026-09-08
[taxonomies]
tags = ["go", "game", "snake", "discovery"]
+++
Using the [Ebitengine](https://ebitengine.org/), I made a very ugly and simple snake game, mostly to learn a bit more
about how game programming works, dip my toes a little bit. You can find [the code here](https://git.bricebernard.dev/Mimu/snake-game).
<!-- more -->
<img class="center" src="snake_go.gif" alt="snake go game gif"/>
I did this purely to see how it feels to write a game loop. That's why there is only one level, randoming a constant
amount of points to eat. The gif above is basically the entire game.
The only addition is pressing the `spacebar` to go at maximum speed.
I didn't really learn anything in Go but it was interesting to write something completely different than the usual
web stuff. I did enjoy it a lot and I'm looking forward to the next one, with bevy while learning rust.
It'll be more polished, maybe.
If I had to point out one aspect I did not enjoy at all, it's **writing text**. It's probably because I'm coming from
the web where this is so trivial, but what a nightmare to size and position. It's 100% a skill issue, I hope, but goddamn.
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

-10
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

-1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long
+12 -1
View File
@@ -173,7 +173,7 @@ textarea {
align-items: center;
.date {
margin-right: 24px;
width: 110px;
opacity: .5;
}
@@ -412,6 +412,17 @@ textarea {
font-size: 1.5rem;
margin: 24px 0 12px;
}
img {
&.center {
display: block;
margin: 24px auto;
}
}
p {
margin-bottom: 24px;
}
}
pre {
+1 -1
View File
@@ -21,7 +21,7 @@
<section class="latest-writing section">
<h1 class="subtitle">Latest writing</h1>
{% for page in section.pages %}
{% if loop.index <= 3 %}
{% if loop.index <= 4 %}
<div class="entry">
<p class="date">{{ page.date | date(format="%d %b %Y") }}</p>
<h3><a href="{{ page.permalink }}">{{ page.title }}</a></h3>