Python Console Game Template
Zimonze

This is a template for a simple console game in Python. It's best played using the repl.run link. The game might not work properly in this post.

The game is grid-based and every character represents one space. The player can be controlled using the arrow keys, and objects that the player can interact with can be placed on grid squares.

If you have any questions, you can ask me in the comments. This is my first post on Repl Talk, hopefully it's good.

You are viewing a single comment. View All
Zimonze

@CodingCactus I'm using sys.stdin to get input. If you have tty.setraw(sys.stdin), then ord(sys.stdin.read(1)) will give you a code as an integer that tells you what key is pressed. Arrow keys are slightly more complicated, since they're a sequence of 3 codes. I first learned this from here, but it's not a proper guide so I suggest looking into better documentation.