ASMR Programming - Coding a Snake Game - No Talking

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 373

  • @GiorgiTarielashvili
    @GiorgiTarielashvili 9 месяцев назад +29

    This makes me motivated and excited to learn python for full stack development

  • @itsinthescript3509
    @itsinthescript3509 2 года назад +158

    This video is great. All this code makes me want to learn more. Keep up the good work!

    • @sebastianchinnici2442
      @sebastianchinnici2442 2 года назад +6

      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:

    • @Sirbozo
      @Sirbozo 9 месяцев назад

      o

  • @polcomiporcar
    @polcomiporcar 3 года назад +393

    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

    • @kiparisov1480
      @kiparisov1480 2 года назад +32

      не баг, а фича

    • @nintendo6783
      @nintendo6783 2 года назад +5

      Внатури

    • @QuiLickr
      @QuiLickr 2 года назад +8

      У тебя должно быть много друзей

    • @wingersonly
      @wingersonly 2 года назад +69

      What on earth are these guys talking about lol

    • @igorz3551
      @igorz3551 2 года назад

      @@wingersonly about ur mom

  • @priyamd4759
    @priyamd4759 2 года назад +20

    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.

  • @alex-oo8oo
    @alex-oo8oo 3 года назад +11

    I love this clicks of keyboard. This is enjoyable.

  • @everjaw1629
    @everjaw1629 3 года назад +145

    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

    • @ServetGulnaroglu
      @ServetGulnaroglu  3 года назад +15

      Thanks for the support! I'm glad to hear that

    • @Arsalanfr
      @Arsalanfr 16 дней назад

      hey are you good at programming now its 3 years im just curious because im starting too

  • @Mmc1t
    @Mmc1t 3 года назад +44

    This is a really interesting and original content.

  • @GDakselishere
    @GDakselishere Год назад +4

    I like ASMR, i like games AND i like proramming.
    This video is the best combo.

  • @kaiitobyte1749
    @kaiitobyte1749 2 года назад +20

    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.

  • @abhilashLeader_07
    @abhilashLeader_07 2 года назад +3

    Keyboard sounds satisfying bro👍

  • @aaaaaaaaaaa9801
    @aaaaaaaaaaa9801 2 года назад +7

    1:01 i aint a programmer but i can tell that this pygame is british

  • @amintahiri3053
    @amintahiri3053 2 года назад +8

    Can u please make an asmr on how to setup visual code? (The way u have it setup looks very nice!)

    • @arnabghosh3776
      @arnabghosh3776 2 года назад

      follow code with harry...
      ruclips.net/video/ks6wF_ooYqo/видео.html

    • @igorz3551
      @igorz3551 2 года назад +2

      Go watch gibi

  • @sadri.gulnaroglu
    @sadri.gulnaroglu 3 года назад +9

    Better layout than before 👍🏿

  • @myfirstchannle-sv8pl
    @myfirstchannle-sv8pl Год назад +1

    non coders: wow this is very inspiring. coders: i give up

  • @keremkesgin5623
    @keremkesgin5623 3 года назад +2

    DAMN THAT FINGERSS

  • @MounirSMalak
    @MounirSMalak 3 года назад +342

    anyone today who doesn’t know what to do, start recording how to make snake game 😂😂😂

    • @natedrake3256
      @natedrake3256 3 года назад +7

      yeah 🤣

    • @fakek1506
      @fakek1506 2 года назад +1

      Here

    • @HeyItsQuantum
      @HeyItsQuantum 2 года назад

      @@Yahavoni death?

    • @HeyItsQuantum
      @HeyItsQuantum 2 года назад

      @@Yahavoni I translated it, it literally says "death"

    • @HeyItsQuantum
      @HeyItsQuantum 2 года назад

      @@Yahavoni yeah I know, you meant "smart", but somewhat reason youtube decided you translate is to "death" 🌚

  • @theseusRJ7
    @theseusRJ7 2 года назад +4

    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.

    • @KaylonR
      @KaylonR 2 года назад

      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

    • @tanmaypatel4152
      @tanmaypatel4152 2 года назад +2

      @@KaylonR 5 // 2 will be 2

  • @temmie3325
    @temmie3325 2 года назад +10

    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

    • @ddddddddddddddddddd6
      @ddddddddddddddddddd6 2 года назад

      Your brain gonna explode, if you will see my java code. This is using in tortures.

  • @Codermaster110
    @Codermaster110 2 года назад +1

    that speed is like lighting :0

    • @ServetGulnaroglu
      @ServetGulnaroglu  2 года назад

      Ka-chow!

    • @Codermaster110
      @Codermaster110 2 года назад

      @@ServetGulnaroglu I am programmer too !

    • @Codermaster110
      @Codermaster110 2 года назад

      @@ServetGulnaroglu and Bro the job you did was amazing I used you Asmar like 10 times now !

  • @willyy_senna
    @willyy_senna 2 года назад

    best way to train! followed step by step :)

  • @MattyDevs
    @MattyDevs 2 года назад +2

    Question. How do you move these screens? What shortcut is that? 0:00

  • @theplant4046
    @theplant4046 2 года назад +1

    That the loudest keyboard I ever Heard

  • @tymo5957
    @tymo5957 2 года назад +4

    Amazing work dude, how long do You learn coding?

    • @IoanaMuthi
      @IoanaMuthi 2 года назад +1

      Probably a while this looks pretty hard

    • @baki82737
      @baki82737 2 года назад

      @@IoanaMuthi this is ez

    • @nintendero65
      @nintendero65 2 года назад

      @@IoanaMuthi not that hard but not that easy

    • @joshua_sauv
      @joshua_sauv 2 года назад

      @@baki82737 lol

  • @المعلمالأكبر-ص5خ
    @المعلمالأكبر-ص5خ 2 года назад +1

    اقسم بالله صوت الكيبورد طرب ولا احسن عازف ارجوا إن تفيد البشرية ...

  • @OrigamiwithEyad
    @OrigamiwithEyad 5 месяцев назад

    keep up with this good work! and try to make more python projects for begginers and avanced programmers

  • @Synthetic_geth
    @Synthetic_geth 2 года назад

    This pleases my ears

  • @fadliardiansyahharahap7439
    @fadliardiansyahharahap7439 3 года назад +4

    I am waiting for you to post this code to your github

  • @animeverse9021
    @animeverse9021 2 года назад +1

    He just coded the game without any testing!!! End he just tested the gane at end 😱😱😅😅

  • @samm-sung5104
    @samm-sung5104 2 года назад

    Why the heck are u so good at goddamn snake?

  • @am-gr__yt4113
    @am-gr__yt4113 Год назад +1

    nice work dude,what's the name of that keyboard??

  • @ahan2309
    @ahan2309 2 года назад +3

    You are very amazing programmer

  • @theseusRJ7
    @theseusRJ7 2 года назад

    This is music to my ears

  • @KeyHub-tw4jz
    @KeyHub-tw4jz 2 года назад +1

    Very good job . You must doing videos every day

  • @mr.octopi1825
    @mr.octopi1825 Год назад +1

    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()

  • @ThanhTran27507
    @ThanhTran27507 3 года назад +1

    please make video: "How I setup vim/nvim". Tks

  • @kirkkong5829
    @kirkkong5829 2 года назад

    This is my new sleeping music

  • @sangkima_4267
    @sangkima_4267 2 года назад +12

    Im Motivated by your coding so i try to code like this.But it shows 50 error, 11 warning,4 weak warning..lol😂😂😂

  • @RP-kz5zo
    @RP-kz5zo 2 года назад +1

    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

    • @mauman9338
      @mauman9338 Год назад

      Same , did you find answer ?

    • @knightOfSun
      @knightOfSun Год назад

      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)

  • @alastor1419
    @alastor1419 2 года назад +1

    As a game dev, I can confirm that game development is for chads

  • @spammergod4125
    @spammergod4125 2 года назад +8

    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.

  • @psph_jakeyt7102
    @psph_jakeyt7102 2 года назад +1

    This is why I wanted to studies ICT In my senior high.

  • @amruthulprakash
    @amruthulprakash 2 года назад +2

    Your Device?

  • @elxanhacatali4866
    @elxanhacatali4866 10 месяцев назад +1

    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?

    • @BlazeTheCatMan
      @BlazeTheCatMan 9 месяцев назад

      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

  • @seight8898
    @seight8898 2 года назад

    Программисты: а ты знаешь как меня возбудить ;)

  • @yorkshire6573
    @yorkshire6573 2 года назад

    Hey at 4:50 how can I get that star !?

  • @himalgiri2225
    @himalgiri2225 3 года назад +2

    We need more video on python plzzzzz

  • @R3cheese28
    @R3cheese28 3 года назад

    really loved the first bug lol

  • @DreadArsenol
    @DreadArsenol 3 года назад +2

    Could you do a video where you explain why you are doing what your doing when coding

    • @igorz3551
      @igorz3551 2 года назад

      Because he likes games 💁‍♀️

  • @dlanyar1251
    @dlanyar1251 3 года назад +5

    What keyboard is that?

  • @Skankhunt-cf6uh
    @Skankhunt-cf6uh Год назад

    Past out during watching (got sleepy)

  • @sandrinjoy
    @sandrinjoy 3 года назад +3

    Time for me to buy both camera 📸 & mic

  • @neonwolf07
    @neonwolf07 2 года назад

    after a long type got something I want

  • @emex1011
    @emex1011 3 года назад +1

    What is that OS?
    P.D: Great video. Like and sub :)

    • @ServetGulnaroglu
      @ServetGulnaroglu  3 года назад +1

      Thanks mate 🎉🎉🎉🚀🙏 macOs monterey

  • @vethokezo5313
    @vethokezo5313 2 года назад

    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....

  • @amiteshwarsingh6099
    @amiteshwarsingh6099 3 года назад +7

    You should try to make this with java !! Loved your video

    • @ServetGulnaroglu
      @ServetGulnaroglu  3 года назад

      Thank you a lot 🚀💥🚀💥💥

    • @theabominator2152
      @theabominator2152 3 года назад

      Is java complicated?

    • @amiteshwarsingh6099
      @amiteshwarsingh6099 3 года назад +1

      @@theabominator2152 no , java basic is really easy but difficult to master

    • @theabominator2152
      @theabominator2152 3 года назад

      @@amiteshwarsingh6099 thanks, appreciate your feedback

    • @cbatchmath7772
      @cbatchmath7772 3 года назад

      @@amiteshwarsingh6099 hmm I know c # and I am a small game dev using unity

  • @cameraman1939
    @cameraman1939 2 года назад

    9:15 can someone explain this part? Im little confused

  • @krishnadasnair8765
    @krishnadasnair8765 2 года назад

    gotta lube those spacebar stabs

  • @nehashekhar2374
    @nehashekhar2374 2 года назад

    Can you tell your vs code font your font is very nice

  • @stickysteve14
    @stickysteve14 Год назад

    just a quick question. why are we making a init_vars a function instead of __init__ and just passing vars? Thanks in advance.

  • @masterclipper6955
    @masterclipper6955 3 года назад +2

    Great video! Just had a quick question how did you and are learning code?

  • @MonkeyDLuffy-sr5sx
    @MonkeyDLuffy-sr5sx 2 года назад

    I’m a noob :< and I am wondering what are those things that you import in the beginning ?

  • @FRPAmbience
    @FRPAmbience 3 года назад +1

    Are you using linux or mac

  • @three-zeros
    @three-zeros 2 года назад +1

    Write a dinosaur running game on Javascript or on Python. I'd like to watch a video about a dinosaur :)

  • @라이브러리안
    @라이브러리안 2 года назад

    keyboard sound cool

    • @atlantic_love
      @atlantic_love 2 года назад

      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.

  • @shivangchheda6311
    @shivangchheda6311 3 года назад

    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

  • @marksekla24
    @marksekla24 2 года назад +1

    What extensions on vs code do you use for this project?

  • @wojciechjeziorski9653
    @wojciechjeziorski9653 2 года назад

    Does anyone know how to change the square defined as a food into any image I want?

  • @huynguyen13008
    @huynguyen13008 Год назад

    smooth sounds

  • @YixSoviet
    @YixSoviet 2 года назад

    what extensions do you use? btw nice video

  • @User--died1234
    @User--died1234 Год назад

    in line 21 its showing in mine that size should be number .....what should i do ?

  • @mc-ciro
    @mc-ciro Год назад

    Hi, what switches do you use?

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 2 года назад

    interesting pygame python game though

  • @Tcrrxzz
    @Tcrrxzz 10 месяцев назад

    Could you extend the code? like adding more features and superpowers

  • @pokemoon4012
    @pokemoon4012 2 года назад

    Making python games with python

  • @mansurecin2871
    @mansurecin2871 3 года назад +6

    next time tetris pleaseee!!

  • @hoangtran5895
    @hoangtran5895 2 года назад

    can you tell me that your extension in vscode,i want to know to setup my vscode,please help me,thanks you very much

  • @MatejL
    @MatejL 2 года назад

    I need that pygame library where can i find it?

  • @thanawatsaiyota9640
    @thanawatsaiyota9640 2 года назад

    Where did you buy the keyboard from?

  • @shivangchheda6311
    @shivangchheda6311 3 года назад

    have u tried brown key switchs

  • @hzzk_
    @hzzk_ 2 года назад +3

    what are your vscode settings, like font, font size, etc.
    seems like a nice setup

  • @shakhriyorokg9007
    @shakhriyorokg9007 2 года назад

    Hello! I rlly like ur videos, can u make a chess nrxt time plz)

  • @comebackcs
    @comebackcs Год назад

    I copied the same code and my key left is not working

  • @hoangtran5895
    @hoangtran5895 2 года назад

    so cool,i like this video

  • @elmascapito-j8r
    @elmascapito-j8r Год назад

    What extension do you do???

  • @muhammedkawsarsaif
    @muhammedkawsarsaif 3 года назад

    i want to see a cheese game in next video..... please😀

  • @gamerinyourtown5592
    @gamerinyourtown5592 3 года назад

    what is the mouse you are using?

  • @neutra4885
    @neutra4885 3 года назад

    Plot twist: he put space after the first y

  • @man7687
    @man7687 2 года назад

    what to do if a snake sometimes passes through an apple?

  • @Havoc625
    @Havoc625 2 года назад

    For some reason, when I launch vscode on my Mac m1, later it is burning hot. Anyone else got the same problem? If so any solutions?

  • @irfanfauzi7082
    @irfanfauzi7082 2 года назад

    I dunno why, but many programmer use keychron keyboard, does it have something special?

  • @diegitolokito15
    @diegitolokito15 2 года назад

    what is your vs theme?

  • @NChindas
    @NChindas 2 года назад

    , line 1, in
    import pygame, sys, time, random
    ModuleNotFoundError: No module named 'pygame'
    any solution ?

    • @francescoabrate4454
      @francescoabrate4454 2 года назад

      Try to install ‘pygame’ libraries with a virtual environment, search on RUclips bro

    • @NChindas
      @NChindas 2 года назад +1

      @@francescoabrate4454 I had already solved it by searching in Google XD, thanks anyway

    • @quza7686
      @quza7686 11 месяцев назад +1

      @@NChindas How??? Help me, please, I can't solve this problem.

    • @quza7686
      @quza7686 11 месяцев назад +1

      @@NChindas The library is pygame installed, I checked through pip list

  • @Pedro19893
    @Pedro19893 Год назад +12

    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?

    • @Gamer-XO
      @Gamer-XO Год назад

      Yes

    • @Pedro19893
      @Pedro19893 Год назад +1

      @@Gamer-XO What about know? You feel the same xD

    • @Gamer-XO
      @Gamer-XO Год назад

      Yes 😂 XD

    • @superhero4586
      @superhero4586 Год назад

      @@Pedro19893 mememe

    • @jermaine2712
      @jermaine2712 Год назад +1

      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.

  • @lobo61259
    @lobo61259 2 года назад

    "TypeError: size must be two numbers"

    • @isaacurban7584
      @isaacurban7584 2 года назад

      try with:
      game_window = pygame.display.set_mode(size=(frame_size_x,frame_size_y))

  • @kiddkarterr
    @kiddkarterr Год назад

    How did you play the game after coding it

  • @QuanNguyen-tl2ou
    @QuanNguyen-tl2ou 2 месяца назад

    What is your keyboard

  • @joaonazz
    @joaonazz 2 года назад

    This video is great.

  • @sunnysandeep2647
    @sunnysandeep2647 2 года назад

    Thank you for motivating me to Giveup 🙂

  • @CentralProcessingUnitCore
    @CentralProcessingUnitCore 2 года назад

    Ayo time to copy some codes hehe

  • @justick8626
    @justick8626 2 года назад

    My terminal said , line 21, in
    TypeError: size must be two number
    How to fix it?

    • @jonanthonii
      @jonanthonii 2 года назад

      replace line 21 with this " game_window = pygame.display.set_mode(size=(frame_size_x, frame_size_y)) "

    • @mauman9338
      @mauman9338 Год назад

      @@jonanthonii hello i did this and i still have that error can you help me please ?