Coding Snake Game In JavaScript
Vložit
- čas přidán 27. 08. 2024
- How to code the snake game in JavaScript: In this video, we will see how you can code the very famous slither aka snake game in javascript. Slither can be coded using a very basic logic which is presented throughout this video. You will learn all the essential bits and pieces of coding a game like "Snake" using pure HTML, CSS and JavaScript.
Download the Source Code: drive.google.c...
►More such projects: • Projects Using HTML, C...
►Checkout my English channel here: / programmingwithharry
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
Comment "#HarryBhai" if you read this 😉😉
You are truly great...no one in the world 🌎 would have provided these high quality contents for free....thank you so much brother ❤️
Can you tell me how to retrieve integer data from firebase
He is legand 🔥😎
Really bro...
@@user-zg3ru3hs2j Harry bro already told that java and javascript are totally different languages.....and there's no language called advance java....when u are done with the basics then move on to advance concepts that's it.... don't make these things complex first check out the videos , understand and then practice
@@user-zg3ru3hs2j java and advance java are same just java is for beginners Here the basic of java are used only and advanced Java are used by pro developer you can make advance apps by advance java and JavaScript and java are fully different java is for android/app development and JavaScript is for web development or if you know JavaScript nicely you can make a website where user can play game JavaScript developer earn a lot of money
You really deserve millions of subscribers for your hardwork........Dil Se Thank you ❤️🙏
Hey, bro please share audios and bg pic that is used in this project...I'm not getting from Internet
@@TimePass-xk3sn Description mae hai download source code mae..👍
Million of subscribers already completed please check 😅
Thank you so much Harry for this project!
I modified it a little- with each 5 interval of score I incremented the speed!
I am trying for some more modifications in it.
I want to be a greatest game programmer with a brilliant Ethical hacker.but now I don't know anything about computer and programming.I WANT TO KNOW WHAT IS YOUR EDUCATION LEVEL NOW IN PROGRAMMING.MEANS BTECH /MTECH.OR ELSE.?
What should I do
Miss please share this codes
Do share your progress if u have made some modifications .
Bro you are amazing man god bless you , I have seen so many programming tutorials and NO ONE teaches like you .You deserve way more , bless you bro
These videos need to be on trending in CZcams.
Can you tell me how to retrieve integer data from firebase
correct
na bhai 👀 pehle hi cs walo ki jobs baaki circuital branches wale le jaate hain.. agar ye trending pe aa gya fir to commerce walo se bhi competition aayega. 😥😭
@@kanwarekamjotsinghdhindsa9129 you're right man🥶
As an engineering student I've learnt a lot of theory but translating it into usable work is always the biggest challenge so thanks for the help
Same happens with me
Codewithharry says "Mei ek hands up person hoon aur mei theory mei bikul bhi beleive nahi karta"
same with me
I'm a beginner in frontend. I can surely say that this project made to like frontend. Thank you brother.
I am a beginner in coding(not even spend one month in college) but I came to know about harry sir and I am amazed and my interest is rising up in coding😁😁😁
Ok I'm agree with you
Waah bhai kyaa baat. Harry bhai k liye ek like to banta hai 🙏🔥🔥happy bhai ek request hai. Mx player jaisa video player banake dikhao bhai with ads. Thankyou so much bhai. Waiting for this video. Hope u make it.
Can you tell me how to retrieve integer data from firebase
You are right bhai
@Azeem Ehsan isiliye to ek bola maine bhai😂
19:04 Harry bhai to google: Bade Harami ho beta 😂
🤣🤣🤣🤣
😂😂
🤣🤣🤣🤣
😂😂😂😂👌👌
🤣🤣🤣
I was searching for projects and trying to implement them for a while. But trust me, this is the first project I have done in one go, with a lot of interest. I learned many new things. Thank you very much Harry Sir! Now I'm going to try every project from your playlist for sure.
Bhai maine toh sara code line to line teep rha hu jb bhai ne food and snake bnaya toh unka browser pr show hua lekin mere browser pr toh sirf board show ho rha hai. Food and snake toh show hi nhi hore😮😢
@@RahulThakur-hf4nt same bro mera bhi yehi issue aaraha hai
@@divinitygod6002 toh kya solution hai bhai iska...aaj tk yahi tk chorr rkha hai🥲😂
This tutorial is amazing, i have learnt a lot of things through this tutorial only🙏💜, keep it up sir, and please bring more tutorials like this
He is my role model .....i get motivated when i watch him .... respect ❤️
sorce code kaha he
This man can educate the world , without thinnking about profit .
Need more peoples like you Sir
You are such an inspiration
After watching your videos i created my own youtube channel Code with Cynthia 😄 Am so grateful to you 💕
Can you tell me how to retrieve integer data from firebase
You are great l.I.Tian
@@GracefulPortraits
mref.child("data").child("device_token").child("res").child("results").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { int intVal = Integer.valueOf(String.valueOf(dataSnapshot.getValue())); Toast.makeText(RestaurantsActivity.this, intVal, Toast.LENGTH_SHORT).show();
}
@@cynthia7709 plz suggest me best channel for learn advance java plz
@@user-zg3ru3hs2j czcams.com/video/eujJs0z8m9E/video.html give me 1 like snake game . thank . share with friend
Loved it brother, i am too a js dev but loved watching how you built this and explained everything so nicely. Kudos to you and your hard work :)
Bhai pllss koi job ho to batana bahot problem m hun ..bas starting ho jaye plss bhai help karna Faridabad n rehta hun 🙏 bhai plss help karna agar kar sktey ho to computer science sey graduation Kari h
@@ss-cw6he lagi kahi?
bro ap mujhe ye bata sktay ho k Harry bhai ka code dekh k mei copy kr rha hu lekin kuch seekh nahi pa rha because ek tarhan se copy paste hi hua aur usmei bhi errors aarahe hain......
Is this usually the case because ye mera first js project hai.......
Thank you bhai❤
Made this project seeing your tutorial
Waiting for your javascript beginner tutorial with notes...🥰
Hope you will upload it soon🥰🥰
Its already there.
Search "Javascript Codewithharry"
@@starash6770 Thanks mate.. I have already watched that video !!
But I am actually talking about the video with note like html and css video with notes.
The videos of html and css were also uploaded previously without notes but harry bro again uploaded it with updated version with notes.
So i am waiting for javascript tutorial with notes 😊❣❣
@@bijay_magar5964 ohh
@@starash6770 hey there bro i need a advice actually i am confused whether i should watch javascript tutorial playlist or the 3 hour video that he put on i can watch only one
@@sarthaksingh7197 If only can watch one then you should go with complete course.
If you already have a good knowledge of js then you can watch one shot video.
But my advice is if you know only some basics of js then watch full course.
You make us understand the logic in simple language!
Hats of to you brother!!
Can you tell me how to retrieve integer data from firebase
connecting mysql is a better option and is easy to retirve data, @CodeWithHarry has explained us this PHP tutorial
@@GracefulPortraits plz suggest me best channel for learn advance java plz
@@user-zg3ru3hs2j code with Harry has made a playlist on java
@@GracefulPortraits advance java bro
Sir app to ho hi khatarnak player , game me bhi aur programming me bhi.
For beginners, have a look at the grid first so that you would know what is happening for the snake positions.
Best Coding Teacher I have ever seen 😘
Please make a series on COMPETITIVE PROGRAMMING & continue the topics left in DSA COURSE 🙏🏻
Thanks for keeping it simple and explaining it in simple words
19:08 💀Google ki suggestion Aaj kal badi ajip si aane lagi hein 💀🤣💀
Harry bhai kis muh se dhanyvad karu aapka 🙏🏻🙏🏻💙💙💙😎💯🤜🤛.
VERRRY VALUABLE CONTENT.
In this day and age everybody is changing money and you are providing free of cost such great courses. Hats off to you Bhaiya 😊
Please make a series on COMPETITIVE PROGRAMMING & continue the topics left in DSA COURSE 🙏🏻
💙
Agar harry bhai jaise teacher har school aur colleges me ho tho socho India kitna aage badh jayega.. we want more teachers like harry bhai
I am 13 year old learning coding from you your videos really help a lot and thanks for you effort
Online class khatam honey ke baad dekhne aata hoon video. Hope this video will be great as usual
मुझे उसी तरह महसूस हो रहा है
😎😎😁👍🏻
Online classes ma samaj nahe ate
I just completed his tutorial on snake game in python yesterday
Me also
Yes bro
Me also
Award chaiye?
@@souvikrajsingh Certificate de do. Kam pe ayega
Watch flappy bird also
normally i dont give reviews but maam youre amazing like i tried 2 videos on 2020 and one on 2022 but it wont work but i saw yr video today and it worked as being both content creators i respect your hard work and keep it up
There is a bug that i would like to highlight that
if the snake is moving a specific direction then it can move in opposite direction(as compared to previous) without rotating and its head also changes (if it has
did you find out the solution?
Noticed the same.
window.requestAnimationFrame(main);
inputDir = {x: 0, y: 0} // Start the game
window.addEventListener('keydown', e =>{
moveSound.play();
switch (e.key) {
case "ArrowUp":
if( inputDir.x !== 0 && inputDir.y !== 1 || inputDir.x === 0 && inputDir.y === 0 ){
console.log("ArrowUp");
inputDir.x = 0;
inputDir.y = -1;
}
break;
case "ArrowDown":
if( inputDir.x !== 0 && inputDir.y !== -1 || inputDir.x === 0 && inputDir.y === 0 ){
console.log("ArrowDown");
inputDir.x = 0;
inputDir.y = 1;
}
break;
case "ArrowLeft":
if( inputDir.x !== 1 && inputDir.y !== 0 || inputDir.x === 0 && inputDir.y === 0 ){
console.log("ArrowLeft");
inputDir.x = -1;
inputDir.y = 0;
}
break;
case "ArrowRight":
if( inputDir.x !== -1 && inputDir.y !== 0 || inputDir.x === 0 && inputDir.y === 0 ){
console.log("ArrowRight");
inputDir.x = 1;
inputDir.y = 0;
}
break;
default:
break;
}
});
Update your code
@@UMAIRI_DEDThis really helped Thank you!!
@@chaithali_ ❤️
THANK YOU SO MUCH HARRY SIR FOR YOUR KNOWLEDGE
This video is very very very very very helpful 💖💖💖💖
This video is very very very very…..............help full for beginners
Harry is becoming healthy nowadays 😁
I wonder, he has eaten python, Java ....😂😂😂😂
Yesss🤣🤣
Ha bhai😂
😂😂😂
Harry bhai this types of game can inhance the coding mindset so plzz ahead new type of game
This video is really helpful as jst watching tutorials of javascript is too boring.
Myyy favourite utuber
Love from kashmir
best channel ever. I have liked his whole videos
Harry Bhai
Harry Bhai
Harry Bhai
Very helpful
From Python 🐍 to Web 🥰
Snake is everywhere 🐍
Can you tell me how to retrieve integer data from firebase
Google ki Suggestions aajkal bahut Ajeeb tarah ki aaney lagi hain.😂👏👍🏻👍👍
Amazing 👌👌😍 !! You are so talented .. I really enjoyed learning JS for the first time..
Agar ap na hote toh pta nhi kya hota
Sayad mere se toh kuch vi na hota
Thank you so much sir ji
M agar pura din likhne lg jau na toh bhi apki tarif nhi kr skta really m thank you sir ❤️
Who thinks that harry bhai should be the world's richest person and he start his own startup❤
Hit like👍
👇
I think
Bro I love him too but likes ke liye khuch bhi mat kaho
I also think
I also think
I also think
Yes sir you really doing hard.tons of love from Nepal
maine apke javascript ke playlist ko bhi access kr rha hu . i love the way u tteach us thank u so much
So many things to learn from this video for me....
I totally love your tutorials ❤ and kindly can you please make a 8-10 hour video for JavaScript, Node-js and Mongo-DB respectively
That would be grateful
you are true human spreading knowledge like a pearl
Very amazing tutorial. No one can beat Harry bhaiya for real....
Harry Bhai Lockdown me Mote Ho gaye😁👌👌❤️
1:10:18 ekdam bhaukal player ho sir aap...🔥🔥🔥
Till now whatever I learned just because of you sir... Really love u...
you explain in every easy way
Love You sir ..❤️❤️❤️ Thanks free m itna kuch sikhne j liye
When he says starting sey leke end tak that feeling ♥️♥️♥️♥️
Wow harry bhai ap kamal ho love from Pakistan
Bhai bah bahi you deserve millions of subscribers literally atleast 34 million and more you should be the top youtuber, you really have done a lot of hardwork and I will keep supporting you until I die you taught me freelancing and I am learning also and earning also bhai I will support you from all my accounts I am having many Google accounts I love Harry Bhai ❤️❤️❤️🥰
First..thank-you sir....it will be really helpful this type of videos are needed.
1:10:11 superb player... Khatarnaak😅
When God come to help poor students ❤️ , Bhaiya you're my Bhagwan
this tutorial is very very help ful
Herry bhai and Khan sir great teacher ❤️❤️❤️❤️❤️❤️❤️👍👍👍👍
Sir aaj aap bhout hi Golu-Molu lag rahe ho😍😍
I am continuing with your java playlist now a day.
Khatarnaak player ho aap
Thankyou so much Harry Bhai, apke wajah se meri pehli job lag gayi, mein graduation ke baad 2 saal tak unemployed thi
Aapne ye project banaya hai??
1st one view 1st commen 1st like harry bhai
1:10:16 bade khatarnak player ho aap
1:22 please zarur add karen harry bhai
You are great teacher harry bhai verry verry thanksssss❤❤❤
Matlab bas kaamaal harry bhai
Bhiya please tell me that Facebook ka employ kiya kaam karta ha and ham bhi kiya wassa kaam kar sakata ha aapaka pura java corse karna ka badd and Facebook ma jaa sakata ha hamm kiya please tell
That right please tell
wah betee!!! mauj kr de ... katai kant player ho
After spending thousands of rupees, I'm convinced this guy is truly a gem and don't buy any online course to learn something cause Harry Bhai is more than sufficient to learn something new.
1:31:05 My suggestion is to create backend with django and make users sign up in the website and then storing the high score then the whole world can see the high score and the rankings will be seen.
By the way salute to your work and really you are a dangerous player. You deserve more than 1 million.
.
really good idea
1:13:36 --- When you see your crush in saree
1:29:44 ---- Harry bhai reaction 😂
@Ram Chandra sahi hai🤣🤣
Literally 😀
Thanks for all these courses, I just have a suggestion :-
• Instead of making 12 hour long courses, please make a playlist and upload small 10 - 30 minute videos there just like your Java playlist.
This JavaScript tutorial is helpful ❤
19:04 GOOGLE ki suggetions boht ajib si aane lagi hai 🤣😂😂🤣
Sir, kindly complete the playlist of data structures and algorithms. And also make a playlist on competitive programming.
All those who wants this ... kindly like this comment. DSA and CP are essential topics for grabbing a decent placement.
Yes bro....those topics are very essential
Hopefully, he will help us bro
🤞🤞🤞
So that we can draw the attention of Harry bhai
Yeahhhh it is running finally mast chlra h ab thank you so much bhaiya mrko I need this whole heartly good night 🥳🥳🥳🥳
thank you sir, another project added to my resume
19:06 , google answers are so weird🤣 🤣
lmfao
Logically thinking indian people need to know that 😂ig thats why search engine is weirdly optimized
Our population is brimming over the cup tbh, ppl are illetrate about that stuff
19:05 Google Is Very Use Full To Gather Information 🤣🤣🤣
This video is Helpful . Please make more game projects
Guru kha hai apke charan aaj to chune ka mn kr rha hai guru 🙏👍
U deserve it sir 🙏
we need more projects with js and react
I have a idea of a project of a car racing game
Bhaiya datastructure ki playlist complete Kijiye please 🙏❣️❣️❣️
Bhai apne videos me time stamps bhi laga diya karo...bhot help milti h
Really you are great playing. Rok nhi paya khud comments krne se. You are ridiculous man and also you have decent skill.
Hi Harry, great work! Very easy to follow :) can you show how to add difficulty level to this? And if we add a start button instead of press any key to start.
good idea i will do this❤
Harry bhai to mote ho gaye....due to lockdown I guess😁😁😁
😂
Yahi comment dhund raha tha 😂
😂😂
Bhai uski income bhi terse moti hai 😂😂
Your videos are always special for all people, I like it
Harry Bhai's game is LIT....
Finnaly in 1 minutes
👍🏼👍🏼👍🏼👍🏼👍🏼👍🏼👍🏼❤️❤️❤️❤️❤️❤️👌👌👌👌👌👌👌💥💥💥💥💥
Firstly, I will create this game on my vs code. Then will give you a challenge on this game. I am also a khatarnaak player
😁 sahi hai good idea
You are gem in this greedy world
Add
doucument.location.reload();
In the last of if section of function gameengine() it will help to update the score value to 0 again n the page will be reloaded everytime you lose.
can you tell me why did we add the requestAnimationFrame(main); in the first line of the function? Its bugging me a bit because it being a recursive function how will the other statements execute if there is no base case...
Sir hame websites banani to aa gayi par ab uss website ko sell kaha kare? Local mai to buy heee nahi kar raha, kya ham online website sell kar sakylte h, yadi online sell sakte h to kaise, please make a video
Yes sir
Yes sur
Contact me apka sell krwadunga
@@cum4movies Where to contact you? On Mail? Do you have Telegram
@@madhavibansal8423 telegram @digitalsanchityt
27:51
Khatarnak Player aur teacher ho AAp bhaiya !!!
You teach very well and bring new games like this 🙏🙏🙏🙏🙏👌👌👌
Sir ham website ko freelacing, ya website ki template ko themeforest pe kaise sell kar sakte h ??
this channel has the best like to dislike ratio in whole youtube
You are a life saver bhaiya...... this video helped a lot🙌🙌 thnkuh do muchhh
You are legend of sanke game....bahut khatarnaak ho