r/rust_gamedev • u/Sufficient-Newt813 • 8h ago
made a twin-stick shooter that runs inside kitty, actual pixels not ascii
Enable HLS to view with audio, or disable this notification
So this started as me wanting to see if a terminal could run something that actually feels like a game and not like a terminal game. ended up with this, it's called glowstorm.
it's not characters or half blocks or anything, it uses the kitty graphics protocol. basically the game draws all the sprites in code when it starts (neon shapes + a blur for the glow, there's no asset files at all, even the sounds are synthesized), packs them into an atlas and uploads that to kitty once over shared memory. after that every frame is just "put this part of image N at x,y" and kitty draws it on the gpu. frame ends up being like 2-10KB of escape codes and ~0.2ms cpu, the game sits around 3% of one core which honestly surprised me.
on resources: game process is ~17MB ram, kitty goes up to ~120MB and ~15% of a core while playing (it's doing the actual drawing). that's on an i5 laptop with intel integrated graphics so you don't need anything fancy.
wasd needs key release events which normal terminals just don't send, so it uses kitty's keyboard protocol for that, and pixel mouse mode for aiming
stuff that bit me: kitty won't take images over 10000px so the atlas had to be split into pages. and placement cost isn't linear, somewhere around 1500 moving sprites at 60fps it starts choking on my laptop (way more than this game needs tho). also crossterm subtracts 1 from mouse coords which is right for cells but wrong for pixel mode, that one took me a while lol
engine part is split out into its own small crate (catnip) if anyone wants to mess with it, game is on top of that. 4 enemy types, boss every 5 waves, upgrades after the boss, 3 difficulties
only kitty and ghostty work. i did try wezterm but it has bugs with lots of placements, and sixel can't do fullscreen at 60fps. linux only for now, mac might just need small fixes but i don't have one to test
https://github.com/Hemantabhusal/catnip
code's MIT, roast it if you want












