Easy JavaScript Game Tutorial
HTML-код
- Опубликовано: 7 ноя 2020
- Learn how to create an easy game using JavaScript. We're going to create a game similar to the chrome dinosaur game (no internet connection game) using plain JavaScript.
We're going to be using HTML, CSS & JavaScript. Feel free to code along to this tutorial & make the game. Hope you enjoy!
Don't forget to Subscribe here: / @krisfoster1
Code: github.com/kriscfoster/chrome... Наука
Kris thank you for posting this excellent example of java script coding.
Also, thank you for posting it in Git.
A great example that I can take apart and show my students in class, please keep posting...!
This was a great video! thank you!!
Awesome man👍
Awesome , loved it !
Thank you @Deltaty Code, Glad you enjoyed!
Awesome! it feels very good to make my own game and play it! I am super interested in learning programming so this was awesome! thanks very much! my best score right now is 313!
Awesome! Simple and precise!
Glad you enjoyed @Cassio Dias 😉
Thanks to your video I can continue my code project
In the css, if you add the linear after the infinite it will gonna have the same speed.
Learnt a lot thanks
THANK YOU SO MUCH!!!!
thank you verymuch a lot
I got stucked around 16.30 cause you didn't reload the page to make the dino keep jumping right? you pressed the spacebar to make the dino jump, right? but for me, I pressed the space bar and it won't jump. I also keep reload the page to see what went wrong and see the difference between my code and yours. but, I can't find anything. I'm a student and I need your explaination, please.
i had the same issue, you have to delete the jump animation in the dino id in your css. it cant be there twice in one css file i guess
Great video, thanks!
Glad you enjoyed @Zach Smith!
Yes! Thanks so much! I always try other tutorials but the animation never works for me. This video really helped me! Thank you!
Glad you enjoyed @HeroicAgenda576!
MY NAME MRRRR CHHHEEEEEEEEEEEEEEEEESE
How would i make it so the 'dino' is actually animated with its legs moving in the og game? i've got both my sprites, i just dont know where to put them.
great tutorial though!
what is the editor you used?
New subscriber
i keep getting "expected an identifier and instead saw const" on the javascript page. any tips on that?
Just followed the tutorial and learned a lot! Thanks, man! Just one sugestion I watched on other video: the rock animation can get smoother if you add "linear"
on CSS:
animation: rock 1.8s infinite linear;
I have to make my webpage where the game is, long it takes up most of my screen space. Any ideas?
I need help with my rock not staying in the box and just slides out but then spawns back to the right spot. So any tips for the rock to stay in the box. And I copied the same code as u
loved the video. really helped me honestly.
Thank you for the feedback @Mirale
can u do a video where u make this game more advanced and interesting?
Nice very nice
Glad you enjoyed @Sertan Sahbaz
Cant we do overflow hidden to hide rock if it gets out of the div?
I tried it and worked also
I just did every thing and my dino still not jump can you help me ?
Thanks. Great video. Explained very well.
I was doing something similar, but I ran into one problem. I'd like to be able to stop the infinite animation once the game is over and even after OK-ing the alert to make sure the game is stopped properly and only if the player wants to play again to press a separate button, which we can tie in with the reload method, which I can figure out how to do, but the only problem I can't solve is stopping the game completely even after the alert is satisfied. If someone can suggets something I'd appreciate it. I'm new and still learning JS. tnx
I ran into the same issue and am also new but will try to explain how I fixed it. Instead of putting the animation for the rock directly in the formatting, I made a separate class list for the rock (just like the animation for the dinosaur is separate). Then, in javascript, I used addEventListener("click") to start the rock-animation when you click on the screen. And then in the final condition to end the game, I just removed the class list from the rock. Hope that makes sense
What code editor are you using?
he uses visual studio code
My dinosaur image isn't showing up, can you explain why?
keeps underlining my colons do anyone know why pls help its not working
Why is that the Dinosaur's legs aren't moving?
How did you align the score. Your screen is covering the code and your accent is hard to understand
my dinasour dosent jump
Thank you, You are awesome but you need to get your voice a little bit higher...
Thank you for the feedback!
My NARM MRE CHREEESERES!
dinosaur is not jumping
MY NAME MR CHEESE!!!
voice is too low
Thank you for the feedback, will try to make it better next time
MRY NRAME MRE CHREsSE