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) —
03.06.2022
You sir have earned a subscribe!
Wow that was quick and sharp
Seeing other poeple coding if fun.
But not coding 🙈🙊
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!
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?
This is amazing, man! Thanks for sharing this with us, keep it up, love the content!
What is the color scheme you are using for vim? I can't find anything like it.
What software is this?
KIng!
Damn, I can only code html and css
the hell did I just watch o.O
Bruh…. bravo
the nice video.Hey guy can you show me your vim config
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?
+10 for VIM, +10 for flawless programming skills, Instant sub!
Not a single code comment.
smh
I broke ALL my computers after seen this guy !
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?
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?
u cheated with vim shortcuts
Your vim is the best
This is how I write codes in my dream.
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
Me at 5:16 in the vid: "Ok, so we just declared a variable 'pos', hmmmm interesting
Bravo
Hungry Turtle: random.thisandthat . . . .math
Me: shocked expression
I like how you describe each function in details while typing.
What's the "Emotionless Focus Meter" for? 😊
Thank you so much sir for this video.
Le Emotionless Focus Meter be like: 🔴🔴🔴🔴🔴
which app to you use to code
I’m just now getting into coding how long would take a beginner to be at this level?
u should try this on the basic notepad
You have good hands on programming.
Amazing talent
Ъ
Please tell me the software name….???
where are you typing…???
Holy shit! The boy did it.
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.
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.
You’re fast and efficient as hell with the key klicks m8
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!
Amazing..
I find watching this more interesting than I used to find playing snake game 17 years back in my father's Nokia 2100!
Hey what font are you using?
I hope you come back, loved the vids just found the channel! Would be awesome if you did a JavaScript course!
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.
People thinking this is real: 🤡
"How to copy code for a snake game in 5min WITHOUT using copy/paste" — fixed your title.
ssss-show
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
I don't even know how i have my current job lol