Coding a Snake Game in 5 mins with Javascript - Speed Coding - playproduction.de

Coding a Snake Game in 5 mins with Javascript – Speed Coding

Hungry Turtle Code
Views: 25856
Like: 1125
This is my attempt at coding a snake game in 5 mins with javascript. Speed coding is not something I do very often but the snake game is such a classic that I thought I would make a coding challenge out of it. This isn’t really a tutorial about building a snake game but I maybe – if i’m lucky – you end up learning a little by the end of the video. Let’s make a javascript snake game then shall we?

❤️ Support Me On Patreon

Github repo for this video:

Share this video with a programmer friend:

✅One Off Donations:
PayPal –
Credit / debit card –

Bitcoin: 39iDX27ZSkYtRhUrH5r5YN128wEjwDmSYp
Ethereum: 0x38b3cBF8Ee3EeeeA33D1925bA0ce0e90c8EcFD46
Horizen (ZEN): znanBCHpWJecBwZZmft9r5QzbzRX4nQn6Dz

🔴 Check Out The Site!

🔔 SUBSCRIBE!

🔥 Join the Community!
Patreon –
Follow Me —
Quora –
Like Me —
linkedin —

Github (Personal) —
Github (Hungry Turtle Code) —

55 Comments

  1. Seeing other poeple coding if fun.
    But not coding 🙈🙊

  2. do you have a video explaining why you're wrapping requestanimationframe with setinterval?

    this is a fixed time step you're implementing? i'm having trouble with this myself (for purposes of keeping physics stable regardless of framerate). thanks in advance!

  3. Massive respect! Your javascript skills are outstanding. I think it must've either been a well rehearsed example or you're some kind of savant. Either way, you did a great job.

    Can I just ask, what was your thinking behind your choice of text editor?

  4. This is amazing, man! Thanks for sharing this with us, keep it up, love the content!

  5. What is the color scheme you are using for vim? I can't find anything like it.

  6. the hell did I just watch o.O

    Bruh…. bravo

  7. the nice video.Hey guy can you show me your vim config

  8. the code worked for me, no offense, but did anyone realise that he didnt refresh the web page before he started to test the snake game?

  9. +10 for VIM, +10 for flawless programming skills, Instant sub!

  10. I broke ALL my computers after seen this guy !

  11. So, given this code, how would you scale the framerate down to make the snake go faster? Since the gameloop is fired outside of the loop it is not affected it seems by changing framerate for example. What would be a good approach?

  12. sir i wrote , the same code as yours and even looked at your github repository ,still my code isnt running , are there any additional requirements
    for this to run? which IDE are you using?

  13. I tried following other 25/45 min long tutorials and struggled to understand anything.
    I understood everything with your 5 min challenge, I think you should make an explained version and it would take you only 2 mins to explain it all cos your code is super clean and simple. thx

  14. Me at 5:16 in the vid: "Ok, so we just declared a variable 'pos', hmmmm interesting

  15. Hungry Turtle: random.thisandthat . . . .math

    Me: shocked expression

  16. I like how you describe each function in details while typing.

    What's the "Emotionless Focus Meter" for? 😊

  17. Le Emotionless Focus Meter be like: 🔴🔴🔴🔴🔴

  18. I’m just now getting into coding how long would take a beginner to be at this level?

  19. Please tell me the software name….???
    where are you typing…???

  20. I appreciate your channel a lot, glad i found it. Could you tell me what colorschem you use in this video? What do you think about a vim tutorial :)? sorry for bad grammar.

  21. There is a bug in line 88 and 89. When you do:

    if (food.x === pos.x && food.y === pos.y) {
    pos.x += vel.x
    pos.y += vel.y
    }

    This causes the snake to move an extra step forward when picking up food. So for example, it will be impossible to pick up food in the corner cause you will move an extra step causing you to go out of the field.

  22. You’re fast and efficient as hell with the key klicks m8

  23. Now that is amazing programming skills! I saw you first on Brad’s channel creating a snake game. I was also very impressed how you used GitHub, Netlify, and Heroku together to make a two player game! Great work!

  24. I find watching this more interesting than I used to find playing snake game 17 years back in my father's Nokia 2100!

  25. I hope you come back, loved the vids just found the channel! Would be awesome if you did a JavaScript course!

  26. He's clearly looking at reference code multiple times in the video, but doesn't really take away much from it. The real impressiveness of the video is his creation of the code that minimizes the amount of lines required to achieve the end goal. Impressive, functional, 10/10.

  27. "How to copy code for a snake game in 5min WITHOUT using copy/paste" — fixed your title.

  28. You're getting about 30wpm, not bad. I usually practice on English sentences but practising typing with source code is also good for getting practice typing those hard to reach symbols

  29. I don't even know how i have my current job lol

Leave a Reply

Your email address will not be published.