Settings

Theme

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

github.com

91 points by mynjin 2 years ago · 22 comments

Reader

troymc 2 years ago

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

https://github.com/kitao/pyxel

  • abhishekbasu 2 years 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 2 years 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 2 years ago

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

    • Phrodo_00 2 years ago

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

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

      • sminem_yt 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago

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

Cool project!

  • FergusArgyll 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago

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

        • otikik 2 years ago

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

      • Nab443 2 years 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 2 years ago

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

      • lofenfew 2 years 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