๐ŸŒ
Invent with Python
inventwithpython.com โ€บ pygcurse
Pygcurse - Curses Emulator for Pygame
Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applications.
Discussions

I was thinking about making a simple ascii game with curses. Here is my very first level editor.
Bonus ASCII Hero I made . Might need to use pygame to use him, but what should I name him? Why not Zoidberg? (\/) (ยฐ,,,ยฐ) (\/) More on reddit.com
๐ŸŒ r/Python
2
24
April 18, 2017
Python snake game!
You could say its a Python python game. More on reddit.com
๐ŸŒ r/learnpython
40
117
July 30, 2018
Blackjack Game in Python 3/curses - Code Review Stack Exchange
You were all so helpful with my Tc Tac Toe games in C. I was encouraged to put it up on GitHub and two very helpful users refactored it in ways that really taught me a thing or two. While I have sw... More on codereview.stackexchange.com
๐ŸŒ codereview.stackexchange.com
January 26, 2019
I made a terminal based snake game using Python and Curses
I know a lot of people make snake games, but this is really great and runs in the terminal. Looks like you did a great job on it. Snake was always one of my favorites. I got to level 28 before my cat decided I was done :P More on reddit.com
๐ŸŒ r/Python
13
47
May 17, 2022
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ i made a terminal based snake game using python and curses
r/Python on Reddit: I made a terminal based snake game using Python and Curses
May 17, 2022 -

A short video demo A screenshot of the settings menu A screenshot of the barrier mode

Since there were no good-looking snake remakes for the terminal, I made my own. It uses ASCII box drawing characters for the snake, so that you can actually tell different segments of the snake apart from each other. It also features a settings menu, the ability to save and clear high scores, a barrier mode, and a configurable difficulty.

To play it, go to https://replit.com/@UniqueOstrich18/CLI-Snake?v=1 or run the commands below:

git clone https://github.com/ading2210/snake-cli
python3 snake-cli/snake.py

Source code is available at: https://github.com/ading2210/snake-cli

Note: The game may have some visual artifacts on MacOS, but I don't own a Mac so I'm not able to fix them.

๐ŸŒ
Medium
medium.com โ€บ @emaildhan โ€บ build-games-with-python-and-curses-b0918e716930
Build Games with Python and Curses | by Danny Han | Medium
August 17, 2018 - Build Games with Python and Curses I just built a game with python and curses, and I think you should too. Why? Because itโ€™s 1) fun, 2) simple, and 3) youโ€™ll learn a lot. Itโ€™s fun. Games should โ€ฆ
๐ŸŒ
Python Engineer
python-engineer.com โ€บ posts โ€บ snake-game-in-python
Snake Game In Python - Python Beginner Tutorial - Python Engineer
import curses from random import randint # setup window curses.initscr() win = curses.newwin(20, 60, 0, 0) # y,x win.keypad(1) curses.noecho() curses.curs_set(0) win.border(0) win.nodelay(1) # -1 # snake and food snake = [(4, 10), (4, 9), (4, 8)] food = (10, 20) win.addch(food[0], food[1], '#') # game logic score = 0 ESC = 27 key = curses.KEY_RIGHT while key != ESC: win.addstr(0, 2, 'Score ' + str(score) + ' ') win.timeout(150 - (len(snake)) // 5 + len(snake)//10 % 120) # increase speed prev_key = key event = win.getch() key = event if event != -1 else prev_key if key not in [curses.KEY_LEFT,
๐ŸŒ
TheAILearner
theailearner.com โ€บ 2019 โ€บ 03 โ€บ 10 โ€บ snake-game-using-python-curses
Snake Game Using Python Curses | TheAILearner
March 10, 2019 - In this tutorial we will learn how to create a snake game using python and curses. What is Curses? The curses is a library that can be used to create text user interface application. It is terminalโ€ฆ
๐ŸŒ
GitHub
github.com โ€บ Ruud14 โ€บ Curses-Snake
GitHub - Ruud14/Curses-Snake: A simple shell snake game made with python and curses.
A simple shell snake game made with python and curses. - Ruud14/Curses-Snake
Author ย  Ruud14
Find elsewhere
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ howto โ€บ curses.html
Curses Programming with Python โ€” Python 3.14.3 documentation
Author, A.M. Kuchling, Eric S. Raymond,, Release, 2.04,. Abstract: This document describes how to use the curses extension module to control text-mode displays. What is curses?: The curses library ...
๐ŸŒ
GitHub
github.com โ€บ JadedTuna โ€บ Python-curses-snake-game
GitHub - JadedTuna/Python-curses-snake-game: Just a simple Snake game made with Python curses module
Snake is a very simple game written using Python curses library. If you found any bugs, or got any ideas how to improve it, contact me at digitloft@gmail.com Version 0.2.2 [+] New I have had fully rewritten the code!
Author ย  JadedTuna
๐ŸŒ
GitHub
github.com โ€บ furrykef โ€บ pygcurse
GitHub - furrykef/pygcurse: Curses library emulation for Python & Pygame
Pygcurse v0.1 alpha http://inventwithpython.com/pygcurse Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, rougelikes, and console-style ...
Author ย  furrykef
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ curses-snake
curses-snake ยท PyPI
April 14, 2020 - The snake console game written with curses.
      ยป pip install curses-snake
    
Published ย  Apr 14, 2020
Version ย  1.0.3
๐ŸŒ
Codementor
codementor.io โ€บ community โ€บ simple python snake game using curses
Simple Python Snake Game using Curses | Codementor
April 12, 2017 - class Snake(object): def __init__(self, x, y, window): # initialize snake: # - create head # - create body # - set starting x, y position def eat_food(self, food): # remove food # stretch body # add score # make the game faster def update(self): # update snake location (move the snake) def render(self): # draw the snake in the console using curses def move(self): # move up down left right
๐ŸŒ
CodePal
codepal.ai โ€บ code generator โ€บ interactive python game with curses
Interactive Python Game with Curses - CodePal
November 14, 2024 - Explore a Python game implementation using the curses library, featuring character movement and wall generation.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ i was thinking about making a simple ascii game with curses. here is my very first level editor.
r/Python on Reddit: I was thinking about making a simple ascii game with curses. Here is my very first level editor.
April 18, 2017 -

So back in high school we made games with QBasic and I wanted to see if I could make a game based on ASCII/unicode characters in python instead. As part of that, I want to be able to create maps that the player can move around on without having to hard-code the x/y coordinate for every map object.

This is the first level editor I have made, and since it's going to be a simple little ASCII/unicode game, I figured I would make the levels text-based(at least for now).

Level's are built with text. A token is a character like # that represents something(in this case a wall:

##################
#                #
#                #
#                #
#                #
#                #
##################

Each token is converted to the character that will be displayed on the map. Since this is a wall, the Wall object will figure out how to display itself based on its neighbors(and ends up looking like lines โ”€โ”˜).

There are 2 objects for the mapping, MapBuilder & Map. And some objects that inherit from MapObject: Floor, Wall & Door.

MapBuilder builds up a Map object and populates the Map instance with MapObjects based on tokens in the text representing the map.

The MapObject objects actually place themselves on the Map through their place method and have access to the Map being built. MapObjects can also control how they are displayed. The Walls have a mind of their own :P

The MapBuilder supports adding MapObjects through classes(passed in a dict with the build method):

class MapObject(object):
    token = str
    color = 0
    drawing = ''
    ch_number = 0

    def __init__(self, y, x):
        self.y, self.x = y, x

    def place(self, game_map):  # game_map is instance of `Map`
        game_map.objects[self.y, self.x] = self

class Floor(MapObject):
    token = ' '
    color = 0
    drawing = ' '
    ch_number = 32

class VerticalDoor(MapObject):
    token = '|'
    color = 233
    drawing = 'โ–’'
    ch_number = 4194401

class HorizontalDoor(MapObject):
    token = '-'
    color = 233
    drawing = 'โ–’'
    ch_number = 4194401

so adding and editing map objects is really flexible.

Here is an imgur gallery with a better example. Those wouldn't be levels in the game, but it shows how it converts everything to the appropriate box character :D Here is what an outline of a room might look like.

Here is the code. You might need to make your terminal window larger to run it since it might try to draw outside of the terminal window otherwise. There are 2 files, editor.py and map_objects.py

Let me know what you think! It could probably be improved, so feedback is more than welcome! My next step will be to write another curses app that lets me use the mouse to draw out the map templates so I don't have to do it in PyCharm.

Bonus ASCII Hero I made. Might need to use pygame to use him, but what should I name him?

Edit: Updated link to the current code. Added more info on how things work under the hood.

๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ python snake game!
r/learnpython on Reddit: Python snake game!
July 30, 2018 -

This is perfect for beginners to learn some python code!

Uses the curses library.

I try to break down each line of code so you understand what is happening. You will still need to do some research if you want more in depth knowledge.

https://github.com/jsterling23/snake-game.py/blob/master/snake-game.py

Make sure you have python installed lol...

Oh and make sure terminal window is at least 200 columns 60 rows. The game needs at least 50x120. But obv~ you can recode that.

๐ŸŒ
GitHub
github.com โ€บ AllanChain โ€บ curses_snake
GitHub - AllanChain/curses_snake: A snake game made in python curses
A snake game made in python curses. Contribute to AllanChain/curses_snake development by creating an account on GitHub.
Author ย  AllanChain