1
0
Fork 0
mirror of https://github.com/Speykious/snaek.git synced 2025-10-28 16:10:01 +01:00
A snake game in Rust almost from scratch
Find a file
2025-05-28 23:42:42 +02:00
.vscode VSCode debugging 2024-04-05 00:42:50 +02:00
assets Different snake impl, debug widgets 2024-05-14 02:59:32 +02:00
src Implement speed increase (after all this time) 2025-05-28 23:42:42 +02:00
.envrc chore: Add Nix support 2024-05-15 02:27:08 +02:00
.gitignore chore: Add Nix support 2024-05-15 02:27:08 +02:00
Cargo.lock update winit and tweak features 2024-07-24 23:04:44 +02:00
Cargo.toml update winit and tweak features 2024-07-24 23:04:44 +02:00
default.nix chore: Add Nix support 2024-05-15 02:27:08 +02:00
flake.lock chore: Add Nix support 2024-05-15 02:27:08 +02:00
flake.nix Fix typo 2024-05-16 01:07:17 +02:00
LICENSE Add Readme and LICENSE 2024-05-15 01:26:31 +02:00
Readme.md Add link to 9e1bbe9 2024-05-15 01:39:59 +02:00
rustfmt.toml rustfmt, cargo fmt 2024-04-12 17:22:18 +02:00
shell.nix chore: Add Nix support 2024-05-15 02:27:08 +02:00

Snaek

Snake game preview

My overengineered snake game!

 

Art mostly by @jumbledFox. Check his minesweeper made in the same style!

Why did I make this?

It was actually just an excuse for me to make my own UI framework from scratch.

I had recently been reading the first free articles of Ryan Fleury's UI series and found it quite fascinating. Before reading this I thought immediate-mode libraries were incapable of handling complex layouts among other things, but it's simply not the case. You can actually perfectly integrate declarative layouts, animations, and persistent widget state with an immediate-mode API and it's most definitely not as battery-draining as people make it to be. (Well, ignoring this project, since I didn't make any rendering optimizations at all...)

So now I really want to use these techniques in any potential future GUI project I might have. That being said, doing stuff with pixels directly has somewhat simplified the abstractions I needed to create (compared to a graphics API like OpenGL or Vulkan), not to mention that I didn't implement anything like a scroll view or a drop down, so it'll probably take way more time to make something that flexible.

Highlights

While coding the renderer for this game, I created the prettiest bug I've ever seen:

Prettiest bug I ever made

You can run the code that produced this bug by checking out this commit if you're curious.

License

This project is licensed under MIT.