DOS was a great platform for developing games. It was simple. It was constrained. We could write code in QBASIC and compile it to EXE and distribute it. It could run on any DOS machine then.

Is there an equivalent like that now for game development? What I am looking for is a simple and constrained environment. Has support for graphics and audio. But in this age, I would like something that works uniformly across Windows, Linux desktop (such as XFCE, GNOME, KDE), and macOS. Is there something like this to create small games like that in the DOS era?

PICO-8 harkens back to limited colors and resolutions, and includes a chiptune editor. It exports to a web player, so should work anywhere.

https://www.lexaloffle.com/pico-8.php

If you want to make an adventure game, you can make a hypercard-like text game in Twine which also exports to the web. You could even draw on old DOS fonts like at https://int10h.org/oldschool-pc-fonts/fontlist/ and style your game like it's 1990!

https://twinery.org/

PICO-8 seems to cost $14.99: https://www.lexaloffle.com/games.php?page=updates

Is this not open source? Are there any open source alternatives to PICO-8? The idea of PICO-8 is really good and I really liked it but I would like this to based on something open source so that I know that the platform will not disappear at the whims of the vendor and that I can hack on the platform itself if necessary.

You can have a look there: https://github.com/paladin-t/fantasy