Creating Snake Game for Terminal | Intro to curses in Python (Part-3)

preview_player
Показать описание
Welcome to the 3rd video of my tutorial series on "curses in Python". In this video, we create the classic "Snake Game" which runs on the terminal!

------------------------------------------------------------

More awesome topics covered here:

------------------------------------------------------------

#curses #python #tutorial
Рекомендации по теме
Комментарии
Автор

I love the fact that you explain very good and you took it from somewhere and gave the source below. keep the good work

vulnoryx
Автор

There's one bug that I fixed.When your snake is moving, the user is not allowed to press the opposite key. So like when your snake is moving right, the user is not allowed to press the left key. But in this game, when your snake is moving right and your press the left key the game ends. So to fix that you can create this dictionary: oppo = {curses.KEY_RIGHT: curses.KEY_LEFT, curses.KEY_LEFT: curses.KEY_RIGHT,
curses.KEY_UP: curses.KEY_DOWN, curses.KEY_DOWN: curses.KEY_UP} . Then before you change the direction to the key you have to check: if direction != oppo[key]. This way nothing happens if you press the opposite key of the snake's direction.

prawnydagrate
Автор

You saved my day! I was looking for a way to capture keyboard strokes, without stopping my Python program.
Thanks for your clear explanation of curses.

RafvandeVreugde
Автор

Thanks Nikhil! The entire curses series was very helpful.

cmohanmails
Автор

I'm so excited! I'm subscribing to your channel.

prawnydagrate
Автор

keep this up love the detail explanation

umarrufai
Автор

Hey can you make one of these tutorials again but with pong?

HACKERSInc
Автор

If user maximize console this code interact with it or need extra coding for maximizing action?

dileepamax
Автор

I wonder if you are still around but which LSP were you using?

ebiscaia
Автор

Thank you very much for the tutorial! For some reason, my game over message won't stay on screen. Instead, it flashes for a second and then takes me back to my terminal, rather than waiting for me to press a key. Is there a way around this?

dylanmarsh
Автор

How do you get curses to run properly in Sublime? It says it cannot find a terminal in the error. Do I have an installation missing?

rvlli
Автор

i dont understand the corrdinates in 7 th line plese explian .ASAP

factsfirst
Автор

i have a error like (ModuleNotFoundError: No module named '_curses')

rajukummari
Автор

I am not getting continuous vertical line of the box. Please suggest

surajmondal
Автор

The food is not added after the first time and even the length. I followed the same procedure too.

vishnuprasad
Автор

i didn't understand the nodelay and timeout part. pls explain (in english pls 🤗)

msn
visit shbcf.ru