Settings

Theme

A (not so) small library for terminal based game development

github.com

91 points by mynjin a year ago · 22 comments

Reader

troymc a year ago

If pygamelib interests you, you might also be interested in Pyxel:

https://github.com/kitao/pyxel

  • abhishekbasu a year ago

    +1 for Pyxel, recently used it for a couple of hours to create a tiny project [1] and loved how intuitive it was.

    [1] https://github.com/abhishekbasu/minesweeper

  • two_handfuls a year ago

    This is very cool!

    As an aside, I find it frustrating how different Python packaged want to be installed in different ways. Pip this, conda that, and now… pipx?

    I worry about how all these systems will interact and conflict.

    • Doxin a year ago

      In by far most cases you can still find the package on pypi.org and install it through pip.

    • Phrodo_00 a year ago

      pipx is not a different packaging system. It uses pip.

      Conda is mostly used by data science people for some reason.

      • sminem_yt a year ago

        Not sure but i think conda can actually build/ship stuff like c/c++ modules for speed up for critical python code. Example: https://www.pymc.io/ i used for mcmc stuff. Installing on windows without conda is practically impossible. On linux (or wsl for that matter) if you have gcc or other compilers installed it works via pip with no issue.

k1ns a year ago

I love ASCII/terminal games. The creativity involved with creating a graphical game in something that was only ever meant to display lines of text is super interesting to experience for yourself. This project far surpasses my own personal library for terminal games, well done.

zamadatix a year ago

With the Windows terminal stack just now merging Sixel support and good clients available on other platforms quick cross platform but graphically heavy terminal games/apps/hacks could get real interesting soon.

0x0203 a year ago

There are also a handful of 3d terminal/ASCII engines out there like this one: https://github.com/sephirot47/AsciiEngine

Arguably less useful than something like pygamelib, but still pretty fun.

blargwill a year ago

If you don't want people to use the internals, why not make them `__private`?

Cool project!

  • FergusArgyll a year ago

    > There is little protections against messing up with the internal. This is on purpose, I want the kids to learn to use the API not mess up with the internals of every single class.

    • setr a year ago

      I don’t understand the reasoning; you’d add protections if you wanted them to learn to use the APIs. You’d remove them if you wanted them to mess with the internals of each class.

      • ncphillips a year ago

        They want people to learn not to mess things up. You learn not to mess up by trying things out and messing up.

        • andrewflnr a year ago

          That's a bad strategy. The reason people are tempted to mess with internals is that it works most of the time. Unless the library has some way of punishing people who use them, then they'll just do it without regard for, as far as they're concerned, arbitrary toothless restrictions. Sure, some stuff will break, but that's true even if they're respecting the API boundary too, especially for a beginner. There will be zero learning about API boundaries in particular.

          • maxbond a year ago

            I think it's fine to encourage beginners to engage with the internals of an API and do things that are unwise. The goal is educated pupils, not successful or maintainable projects. Let them play in the mud and get dirty. I think the idea that code is something that can be experimented with is one of the most valuable lessons, and breaking things is frequently the path to learning how they work.

            Maintainability is one of the finer points that can come later.

            • fbdab103 a year ago

              Games are notorious for vendoring a dependency and never upgrading it again. If you use an internal API, it is not like you are forced to be on the upgrade treadmill where the sands suddenly shifted and the secret API does something different.

            • andrewflnr a year ago

              Oh, certainly. That's much more reasonable than what this project claims to be trying. :)

        • otikik a year ago

          Yeah, you learn valuable lessons like “don’t mess with the code this guy makes, he puts traps on it”

      • Nab443 a year ago

        They mean that their code is written with strong assumption everything is written the way it is. If you make modifications to the internal or push an unexpexted type in it, they expected it to fail. There's no guardrail that everything is in a right state.. well, standard internal code.

    • jon-wood a year ago

      "I left this shotgun here, kids need to learn that shooting yourself in the foot really hurts."

      • lofenfew a year ago

        This is parenting 101 for anything non-permanent. For a piece of software it's basically common sense.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection