Rust tile game
Oct. 22nd, 2024 10:27 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I've been learning rust by writing a simple tile-based puzzle game. To my immense pleasure, the simple game engine I was using, Macroquad, made it mostly easy to put the existing game on a website (as well as on linux, windows, and android, not all tried out.) So far there's no actual puzzles, but I really like the fish I drew (the crab is not mine).
Play online at:
https://cartesiandaemon.github.io/rusttilegame/tilegame.html
It runs on mobile browser, but it's a lot easier to control on a desktop browser. If you have a keyboard, control the crab with the arrow keys and try to get to the exit. You can also click/press the top part of the screen to move up, etc.
Rust (an an extra decade or so of experience) has been great for "if it compiles, it probably works"!
PS. See source on github: https://github.com/CartesianDaemon/rusttilegame
Play online at:
https://cartesiandaemon.github.io/rusttilegame/tilegame.html
It runs on mobile browser, but it's a lot easier to control on a desktop browser. If you have a keyboard, control the crab with the arrow keys and try to get to the exit. You can also click/press the top part of the screen to move up, etc.
Rust (an an extra decade or so of experience) has been great for "if it compiles, it probably works"!
PS. See source on github: https://github.com/CartesianDaemon/rusttilegame
no subject
Date: 2024-10-22 09:30 am (UTC)That which worked on linux, but completely failed to work in web assembly, and it took some time to work out what wasn't working. Of course, once I realised, I remembered web programming HAS to use a single thread which (I think) HAS to do background work for any "OS" operations.
So I had to go and add "async fn" and ".await" to all the functions and calls in its call stack. I understand what the "two colours of function" essay was complaining about, the existing syntax for async is off, although I don't agree with his conclusion.