It's happening the same but learning programming overall, directly with web progrramming, it's kinda odd for me because I love and I'm studying graphic design, 3D design and motion graphics (and drawing but it's a hobby) and getting interested in web programming is striking for me now thanks by his videos 0:
Very encouraging ... I am not in gaming but I have several problems to be solved and if after learning python i can solve a problem in an hours coding effort then I have saved myself a ton of time. Thanks a lot. And yes, No Talking is phenomenal.
There's a bug with the spawn of the apples, as they are random in all screen they can spawn inside the snake's body. It's not that difficult to change but be careful with that
Incredible good friend I almost have no idea of the code you wrote because I am just beginning to learn to program some friend advice. By the way I loved your video, keep it up
The video is interesting and I loved the programming you did, but just as a recommendation, you should change the color of the pixel of the head of the snake to know which direction it will go.
I almost relaxed and then in the first 76 seconds: 0. # Because programmers count from 0 She resizes her window aggressively 1. She makes a lotta typos 2. She messed up equals on line 8 3. She puts a comment in self-explanatory variables 4. She uses brackets in if statement on line 13 5. Even if you have brackets in if statement, at least put a space! 6. She makes a whole lot of empty line, so much empty space that even your mom fits there # couldn't miss the opportunity 7. (probably) If the variable can't be negative and you check it to be bigger than 0, use != or not keyword. If the variable can be negative, ignore this. 7 mistakes on 13 lines! I mean, that's just mostly syntactic sugar, but umm... BrainError: brain exploded of such bad code
i dont get, why you never read doc for pygame and so on pygame.display.set_mode((1920, 1080)) # Initialize a window or screen for display set_mode(size=(0, 0), flags=0, depth=0, display=0, vsync=0)
Merhaba, klavyeden cok memnunum. Kucuk, sade bir klavye. Sesi de cok iyi, ben red switch kullaniyorum. Bluetooth ile ilgili de bir sorun yasamadim. Evet, aciklamadaki link.
This is the code I used to program snake in python. I changed the colors from green and red to blue and yellow to give it the python colors. You can change the speed, screen size, how many tails to start with, and the colors. All that will be located at the top of the code, so feel free to modify the code however you like. from tkinter import * import random GAME_WIDTH = 1000 GAME_HEIGHT = 700 SPEED = 80 SPACE_SIZE = 50 BODY_PARTS = 3 SNAKE_COLOR = "#0000FF" FOOD_COLOR = "#FFFF00" BACKGROUND_COLOR = "#000000" class Snake: def __init__(self): self.body_size = BODY_PARTS self.coordinates = [] self.squares = [] for i in range(0, BODY_PARTS): self.coordinates.append([0,0]) for x, y in self.coordinates: square = canvas.create_rectangle(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=SNAKE_COLOR, tag="snake") self.squares.append(square) class Food: def __init__(self): x = random.randint(0, (GAME_WIDTH / SPACE_SIZE)-1) * SPACE_SIZE y = random.randint(0, (GAME_HEIGHT / SPACE_SIZE) - 1) * SPACE_SIZE self.coordinates = [x, y] canvas.create_oval(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=FOOD_COLOR, tag="food") def next_turn(snake, food): x, y = snake.coordinates[0] if direction == "up": y -= SPACE_SIZE elif direction == "down": y += SPACE_SIZE elif direction == "left": x -= SPACE_SIZE elif direction == "right": x += SPACE_SIZE snake.coordinates.insert(0, (x, y)) square = canvas.create_rectangle(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=SNAKE_COLOR) snake.squares.insert(0, square) if x == food.coordinates[0] and y == food.coordinates[1]: global score score += 1 label.config(text="Score:{}".format(score)) canvas.delete("food") food = Food() else: del snake.coordinates[-1] canvas.delete(snake.squares[-1]) del snake.squares[-1] if check_collisions(snake): game_over() else: window.after(SPEED, next_turn, snake, food) def change_direction(new_direction): global direction if new_direction == 'left': if direction != 'right': direction = new_direction elif new_direction == 'right': if direction != 'left': direction = new_direction elif new_direction == 'up': if direction != 'down': direction = new_direction elif new_direction == 'down': if direction != 'up': direction = new_direction def check_collisions(snake): x, y = snake.coordinates[0] if x < 0 or x >= GAME_WIDTH: return True elif y < 0 or y >= GAME_HEIGHT: return True for body_part in snake.coordinates[1:]: if x == body_part[0] and y == body_part[1]: print("Game Over") return True return False def game_over(): canvas.delete(ALL) canvas.create_text(canvas.winfo_width()/2, canvas.winfo_height()/2,font=('consolas',50), text="GAME OVER", fill="red", tag="gameover!") window = Tk() window.title("Snake Game") window.resizable(False, False) score = 0 direction = "down" label = Label(window, text="Score:{}".format(score), font=('consolas', 40)) label.pack() canvas = Canvas(window, bg=BACKGROUND_COLOR, height=GAME_HEIGHT, width=GAME_WIDTH) canvas.pack() window.update() window_width = window.winfo_width() window_height = window.winfo_height() screen_width = window.winfo_screenwidth() screen_height = window.winfo_screenheight() x = int ((screen_width/2) - (window_width/2)) y = int ((screen_height/10) - (window_height/10)) window.geometry(f"{window_width}x{window_height}+{x}+{y}") window.bind('', lambda event: change_direction('left')) window.bind('', lambda event: change_direction('right')) window.bind('', lambda event: change_direction('up')) window.bind('', lambda event: change_direction('down')) snake = Snake() food = Food() next_turn(snake, food) window.mainloop()
Ah yes the art of copying from a second monitor Also the framework you are using, pygame, a wrapper for SDL2 written in C Allows you to use colors within strings You dont need to define constant global variables at the top, and can directly use "blue" or "black" wherever you want.
As someone who has just started learning Python, I'm just like "How the hell does he know all of this from memory" I feel like I will never be capable of doing this on my own... Did anyone else feel the same at the beginning?
I feel the same but I think this comes from experience. He/she has probably done this a million times, it's almost like a second nature to them. Just like driving a car or a bike.
Hocam merhaba ben game_window = pygame.display.set_mode(frame_size_x, frame_size_y) bu bölümde hata aliyorum hatada söyle : Özel durum oluştu: TypeError size must be two numbers File "/Users/atahanuzerrr/Desktop/pyhton proje 1/proje1.py", line 21, in game_window = pygame.display.set_mode(frame_size_x, frame_size_y) bunu nasıl düzeltebilirim
It sounds like a mechanical keyboard you can find on Amazon, but it is WAY too small. Not sure what he thinks he's accomplishing by using something that isn't ergonomic.
This makes me motivated and excited to learn python for full stack development
This video is great. All this code makes me want to learn more. Keep up the good work!
It's happening the same but learning programming overall, directly with web progrramming, it's kinda odd for me because I love and I'm studying graphic design, 3D design and motion graphics (and drawing but it's a hobby) and getting interested in web programming is striking for me now thanks by his videos 0:
o
Very encouraging ... I am not in gaming but I have several problems to be solved and if after learning python i can solve a problem in an hours coding effort then I have saved myself a ton of time. Thanks a lot. And yes, No Talking is phenomenal.
There's a bug with the spawn of the apples, as they are random in all screen they can spawn inside the snake's body. It's not that difficult to change but be careful with that
не баг, а фича
Внатури
У тебя должно быть много друзей
What on earth are these guys talking about lol
@@wingersonly about ur mom
I love this clicks of keyboard. This is enjoyable.
Glad to hear that 🎉🎉🎉
@@ServetGulnaroglu :3
@@ServetGulnaroglu is that K2 keyboard?
Incredible good friend I almost have no idea of the code you wrote because I am just beginning to learn to program some friend advice. By the way I loved your video, keep it up
Thanks for the support! I'm glad to hear that
hey are you good at programming now its 3 years im just curious because im starting too
I like ASMR, i like games AND i like proramming.
This video is the best combo.
This is a really interesting and original content.
Нифига не оригинальный контент
Шутька!
anyone today who doesn’t know what to do, start recording how to make snake game 😂😂😂
yeah 🤣
Here
@@Yahavoni death?
@@Yahavoni I translated it, it literally says "death"
@@Yahavoni yeah I know, you meant "smart", but somewhat reason youtube decided you translate is to "death" 🌚
Keyboard sounds satisfying bro👍
Better layout than before 👍🏿
Thank you for the feedback
The video is interesting and I loved the programming you did, but just as a recommendation, you should change the color of the pixel of the head of the snake to know which direction it will go.
This pleases my ears
DAMN THAT FINGERSS
You are very amazing programmer
best way to train! followed step by step :)
Question. How do you move these screens? What shortcut is that? 0:00
In Windows is alt + tab
5:16 line 40, why are you dividing the frame size with square size and multiplying it again? It will just return the frame size.
double / isn't dividng, its called floored division where it for example:
5//2=3
so you multiply this back up and you get a rounded frame size
@@KaylonR 5 // 2 will be 2
He just coded the game without any testing!!! End he just tested the gane at end 😱😱😅😅
I almost relaxed and then in the first 76 seconds:
0. # Because programmers count from 0
She resizes her window aggressively
1. She makes a lotta typos
2. She messed up equals on line 8
3. She puts a comment in self-explanatory variables
4. She uses brackets in if statement on line 13
5. Even if you have brackets in if statement, at least put a space!
6. She makes a whole lot of empty line, so much empty space that even your mom fits there
# couldn't miss the opportunity
7. (probably) If the variable can't be negative and you check it to be bigger than 0, use != or not keyword. If the variable can be negative, ignore this.
7 mistakes on 13 lines! I mean, that's just mostly syntactic sugar, but umm... BrainError: brain exploded of such bad code
Your brain gonna explode, if you will see my java code. This is using in tortures.
non coders: wow this is very inspiring. coders: i give up
This is music to my ears
This is my new sleeping music
1:01 i aint a programmer but i can tell that this pygame is british
Can u please make an asmr on how to setup visual code? (The way u have it setup looks very nice!)
follow code with harry...
ua-cam.com/video/ks6wF_ooYqo/v-deo.html
Go watch gibi
Hey at 4:50 how can I get that star !?
game_window = pygame.display.set_mode(frame_size_x, frame_size_y). I am getting an error that size must be two numbers... Any help
Same , did you find answer ?
i dont get, why you never read doc for pygame and so on
pygame.display.set_mode((1920, 1080))
# Initialize a window or screen for display
set_mode(size=(0, 0), flags=0, depth=0, display=0, vsync=0)
abi çok güzel yazıyorsun ama ben bunu yazdım harfi harfine bana hata veriyor diyorki pygame olmaz pygame'i yanlış yazıyor ne için böyle oluyor abi?
Did you install pygame from the command prompt!? If not you need to and if you are asking how just go to command prompt and type pip install pygame
nice work dude,what's the name of that keyboard??
Steve
smooth sounds
keep up with this good work! and try to make more python projects for begginers and avanced programmers
really loved the first bug lol
that speed is like lighting :0
Ka-chow!
@@ServetGulnaroglu I am programmer too !
@@ServetGulnaroglu and Bro the job you did was amazing I used you Asmar like 10 times now !
اقسم بالله صوت الكيبورد طرب ولا احسن عازف ارجوا إن تفيد البشرية ...
What keyboard is that?
Skylong SK64 Red Switches
so cool,i like this video
As a game dev, I can confirm that game development is for chads
Very good job . You must doing videos every day
Amazing work dude, how long do You learn coding?
Probably a while this looks pretty hard
@@IoanaMuthi this is ez
@@IoanaMuthi not that hard but not that easy
@@baki82737 lol
just a quick question. why are we making a init_vars a function instead of __init__ and just passing vars? Thanks in advance.
What extensions on vs code do you use for this project?
.py
I’m a noob :< and I am wondering what are those things that you import in the beginning ?
This video is great.
Why the heck are u so good at goddamn snake?
I am waiting for you to post this code to your github
Sorry for the delay. The link is in the description now.
@@ServetGulnaroglu thank you my bro
It's great but I'm still finding difficult to run ..I'm still beginner..what did you type it's abit fast so I couldn't get it....
Your Device?
please make video: "How I setup vim/nvim". Tks
Nice Programming
have u tried brown key switch
what brand are this switchs gateron or cherry mx
if u have tried brown which do u like red or brown
What is that OS?
P.D: Great video. Like and sub :)
Thanks mate 🎉🎉🎉🚀🙏 macOs monterey
Are you using linux or mac
Im Motivated by your coding so i try to code like this.But it shows 50 error, 11 warning,4 weak warning..lol😂😂😂
Past out during watching (got sleepy)
hocam merhaba, klavyeden memnun musun? satın aldığın yer açıklama kısmındaki site mi?
Merhaba, klavyeden cok memnunum. Kucuk, sade bir klavye. Sesi de cok iyi, ben red switch kullaniyorum. Bluetooth ile ilgili de bir sorun yasamadim. Evet, aciklamadaki link.
@@ServetGulnaroglu geri dönüşünüz için çok teşekkür ederim.
9:15 can someone explain this part? Im little confused
what are your vscode settings, like font, font size, etc.
seems like a nice setup
Mf fr these are the defaults💀
@@HTWwpzIuqaObMt lmao
Can you tell your vs code font your font is very nice
Tebrikler servet süpersin.
Teşekkür ederim 🚀🚀💥💥🙏
wow, amazing
Hi, what switches do you use?
That the loudest keyboard I ever Heard
I need that pygame library where can i find it?
can you tell me name of your keyboard
😀😀
have u tried brown key switchs
This is best upload more please
Really glad to hear that 🚀🚀💥💥💥
Where did you buy the keyboard from?
can you tell me that your extension in vscode,i want to know to setup my vscode,please help me,thanks you very much
How did you play the game after coding it
Was really fun
This is why I wanted to studies ICT In my senior high.
Great video! Just had a quick question how did you and are learning code?
I'm still learning it and I'm self learning
spek engrish num nuts
@@user-nf3vd6kv7ewhat- WHAT THE F-
What extension do you do???
Awesome 👍
Thank you! Cheers!
What complilar did u use?
Can u code it with C ?
Visual Studio Code
what is the mouse you are using?
What is your keyboard
in line 21 its showing in mine that size should be number .....what should i do ?
Great video basarilarin devamini dilerim ;)
What's your font?
Jet Brains Mono
I dunno why, but many programmer use keychron keyboard, does it have something special?
This is the code I used to program snake in python. I changed the colors from green and red to blue and yellow to give it the python colors. You can change the speed, screen size, how many tails to start with, and the colors. All that will be located at the top of the code, so feel free to modify the code however you like.
from tkinter import *
import random
GAME_WIDTH = 1000
GAME_HEIGHT = 700
SPEED = 80
SPACE_SIZE = 50
BODY_PARTS = 3
SNAKE_COLOR = "#0000FF"
FOOD_COLOR = "#FFFF00"
BACKGROUND_COLOR = "#000000"
class Snake:
def __init__(self):
self.body_size = BODY_PARTS
self.coordinates = []
self.squares = []
for i in range(0, BODY_PARTS):
self.coordinates.append([0,0])
for x, y in self.coordinates:
square = canvas.create_rectangle(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=SNAKE_COLOR, tag="snake")
self.squares.append(square)
class Food:
def __init__(self):
x = random.randint(0, (GAME_WIDTH / SPACE_SIZE)-1) * SPACE_SIZE
y = random.randint(0, (GAME_HEIGHT / SPACE_SIZE) - 1) * SPACE_SIZE
self.coordinates = [x, y]
canvas.create_oval(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=FOOD_COLOR, tag="food")
def next_turn(snake, food):
x, y = snake.coordinates[0]
if direction == "up":
y -= SPACE_SIZE
elif direction == "down":
y += SPACE_SIZE
elif direction == "left":
x -= SPACE_SIZE
elif direction == "right":
x += SPACE_SIZE
snake.coordinates.insert(0, (x, y))
square = canvas.create_rectangle(x, y, x + SPACE_SIZE, y + SPACE_SIZE, fill=SNAKE_COLOR)
snake.squares.insert(0, square)
if x == food.coordinates[0] and y == food.coordinates[1]:
global score
score += 1
label.config(text="Score:{}".format(score))
canvas.delete("food")
food = Food()
else:
del snake.coordinates[-1]
canvas.delete(snake.squares[-1])
del snake.squares[-1]
if check_collisions(snake):
game_over()
else:
window.after(SPEED, next_turn, snake, food)
def change_direction(new_direction):
global direction
if new_direction == 'left':
if direction != 'right':
direction = new_direction
elif new_direction == 'right':
if direction != 'left':
direction = new_direction
elif new_direction == 'up':
if direction != 'down':
direction = new_direction
elif new_direction == 'down':
if direction != 'up':
direction = new_direction
def check_collisions(snake):
x, y = snake.coordinates[0]
if x < 0 or x >= GAME_WIDTH:
return True
elif y < 0 or y >= GAME_HEIGHT:
return True
for body_part in snake.coordinates[1:]:
if x == body_part[0] and y == body_part[1]:
print("Game Over")
return True
return False
def game_over():
canvas.delete(ALL)
canvas.create_text(canvas.winfo_width()/2, canvas.winfo_height()/2,font=('consolas',50), text="GAME OVER", fill="red", tag="gameover!")
window = Tk()
window.title("Snake Game")
window.resizable(False, False)
score = 0
direction = "down"
label = Label(window, text="Score:{}".format(score), font=('consolas', 40))
label.pack()
canvas = Canvas(window, bg=BACKGROUND_COLOR, height=GAME_HEIGHT, width=GAME_WIDTH)
canvas.pack()
window.update()
window_width = window.winfo_width()
window_height = window.winfo_height()
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
x = int ((screen_width/2) - (window_width/2))
y = int ((screen_height/10) - (window_height/10))
window.geometry(f"{window_width}x{window_height}+{x}+{y}")
window.bind('', lambda event: change_direction('left'))
window.bind('', lambda event: change_direction('right'))
window.bind('', lambda event: change_direction('up'))
window.bind('', lambda event: change_direction('down'))
snake = Snake()
food = Food()
next_turn(snake, food)
window.mainloop()
Time for me to buy both camera 📸 & mic
what is your vs theme?
Could you do a video where you explain why you are doing what your doing when coding
Because he likes games 💁♀️
Программисты: а ты знаешь как меня возбудить ;)
Güzel ASMR :)
Tesekkurler
Nice
nice video
what extensions do you use? btw nice video
Visual Studio Code😊
after a long type got something I want
Ah yes the art of copying from a second monitor
Also the framework you are using, pygame, a wrapper for SDL2 written in C
Allows you to use colors within strings
You dont need to define constant global variables at the top, and can directly use "blue" or "black" wherever you want.
Hello.
What is your keyboard name?
Steve
, line 1, in
import pygame, sys, time, random
ModuleNotFoundError: No module named 'pygame'
any solution ?
Try to install ‘pygame’ libraries with a virtual environment, search on UA-cam bro
@@francescoabrate4454 I had already solved it by searching in Google XD, thanks anyway
@@NChindas How??? Help me, please, I can't solve this problem.
@@NChindas The library is pygame installed, I checked through pip list
As someone who has just started learning Python, I'm just like "How the hell does he know all of this from memory" I feel like I will never be capable of doing this on my own...
Did anyone else feel the same at the beginning?
Yes
@@Gamer-XO What about know? You feel the same xD
Yes 😂 XD
@@Pedro19893 mememe
I feel the same but I think this comes from experience. He/she has probably done this a million times, it's almost like a second nature to them.
Just like driving a car or a bike.
bro coding agresive
Hocam merhaba ben
game_window = pygame.display.set_mode(frame_size_x, frame_size_y) bu bölümde hata aliyorum
hatada söyle : Özel durum oluştu: TypeError
size must be two numbers
File "/Users/atahanuzerrr/Desktop/pyhton proje 1/proje1.py", line 21, in
game_window = pygame.display.set_mode(frame_size_x, frame_size_y)
bunu nasıl düzeltebilirim
aynı hata bendede.
yapman gereken ((frame_size_x, frame_size_y)) yazmak sadece
Does anyone know how to change the square defined as a food into any image I want?
keyboard sound cool
It sounds like a mechanical keyboard you can find on Amazon, but it is WAY too small. Not sure what he thinks he's accomplishing by using something that isn't ergonomic.
My terminal said , line 21, in
TypeError: size must be two number
How to fix it?
replace line 21 with this " game_window = pygame.display.set_mode(size=(frame_size_x, frame_size_y)) "
@@jonanthonii hello i did this and i still have that error can you help me please ?