https://github.com/speykious/snaek
a snake game in Rust almost from scratch
https://github.com/speykious/snaek
from-scratch gui snake snake-game
Last synced: 29 days ago
JSON representation
a snake game in Rust almost from scratch
- Host: GitHub
- URL: https://github.com/speykious/snaek
- Owner: Speykious
- License: mit
- Created: 2024-04-04T23:16:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-24T21:04:49.000Z (9 months ago)
- Last Synced: 2025-03-19T19:02:00.295Z (about 1 month ago)
- Topics: from-scratch, gui, snake, snake-game
- Language: Rust
- Homepage:
- Size: 372 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Snaek
![]()
My overengineered snake game!
> Art mostly by @jumbledFox.
> Check his [minesweeper](https://github.com/jumbledFox/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](https://www.rfleury.com/p/ui-series-table-of-contents) 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:
![]()
You can run the code that produced this bug by checking out [this commit](https://github.com/Speykious/snaek/commit/9e1bbe9d9b0187037d5ec48ca6dd1bc28b1f4f97) if you're curious.
## License
This project is licensed under [MIT](/LICENSE).