blitzkit
In which I develop a wrapper around wgpu-rs to create a graphics development engine in rust.
2d and 3d. I've got a few games built on it so far.
Feel free to follow along!
Games built on it
- pong
- snake
- tessera
- marble first 3d game here
- slider second. fly through a tunnel, try to thread through the rings
- starry third. a sliding tile puzzle of starry night
- lantern fourth. a dark maze
- securitysweep fifth, a searchlight game
- carom sixth, one player game of marbles
- poolhall seventh, pool
The examples below live in this repo. The games are their own repos.
Examples
Each one has its command below. Pressing escape is how to quit.
rolling, the collision detection. Roll a ball round a walled room with WASD or the arrow keys. It slides along the walls instead of going through them, and settles into corners.
cargo run --release --example rolling
WASD or the arrow keys roll the ball and the camera follows it. Move the mouse to
swing the camera around, and scroll to zoom.

stacking, bodies holding each other up. A column of spheres five high and a pyramid of them four rows deep, standing there instead of sinking through each other. The readout is how far the bottom sphere of the column has gone below where it should rest.
cargo run --release --example stacking
Hold the left button on a sphere to wind it up and let go to shove it away from
the camera, which is how to knock the column over. It runs to red as it winds,
and it comes on late: half a second in it rolls a few units, three quarters of a
second and it reaches the edge, and wound right to the end it goes bright red and
leaves the frame inside half a second. Aim is taken when you let go, so one can be wound up and
then pointed. K pulls the rails out from either side of the pyramid and puts
them back, space builds the whole thing again, dragging with the right button
turns the camera, and scrolling zooms.
The rails are there because loose spheres will not hold a pyramid up on their own: each ball sitting in a valley shoves the two beneath it apart, and only the floor's grip resists. Pulling them is the quickest way to see it. Four rows slump into two and the pile spreads into a loose mound, while the column at the far end stands there untouched.
Push one off the edge and it is gone for good rather than falling for ever, which is what it did until the readout was found reporting a sphere eight thousand units down.

cubes, A demonstration of more sophisticated lighting. L takes you through the different modes one at a time. The sun is placed infinitely away so it has a direction with no defined position. There's nothing to draw for it, and turning it off is the only way to see what it was doing. The spots cast down their cones; the lamp casts every way at once.
cargo run --release --example cubes
Same controls, the arrow keys. Using the mouse works as well. Play around.

teapot, the Utah teapot, from the points Newell measured off a real one in 1975. Pressing T makes it translucent.
cargo run --release --example teapot
Drag to turn it any way at all, or use the arrows. Press Q and E to roll it. Press T to make it translucent. Scroll to move closer or further. Press R to put it back where it started. And press space to lock the cursor.


klein, a Klein bottle you can spin any way you like. M for the solid surface, T for glass.
cargo run --release --example klein
The same controls as the teapot, plus M to swap the wire mesh for the solid surface.


tunnel, a checkered tunnel that wanders, and rings to fly through.
cargo run --release --example tunnel
Steer with the mouse. It flies itself. It gets faster the further you get, and brushing the wall costs you speed. Press space to lock the cursor. Press R to start over.

License
MIT or Apache-2.0, whichever suits you.
The font, Press Start 2P, isn't mine. It's under the SIL Open Font License 1.1,
and that license travels with it in res/fonts/OFL.txt.
I asked AI to draft this for me. I've edited it. Any surviving AI smells are my oversight.
sierpinski, If you know, you know.
cargo run --release --example sierpinski

menger, Another fractal example.
cargo run --release --example menger

hilbert, I didn't know what this was until I got into this space of weird 3d geometries. I just think it's neat.
cargo run --release --example hilbert
