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...
  • НаукаНаука

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

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

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

  • @benbrown1143
    @benbrown1143 6 месяцев назад

    This was a great video! thank you!!

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

    Awesome man👍

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

    Awesome , loved it !

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

      Thank you @Deltaty Code, Glad you enjoyed!

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

    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!

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

    Awesome! Simple and precise!

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

      Glad you enjoyed @Cassio Dias 😉

  • @Thunder-tv2sm
    @Thunder-tv2sm 2 года назад

    Thanks to your video I can continue my code project

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

    In the css, if you add the linear after the infinite it will gonna have the same speed.

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

    Learnt a lot thanks

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

    THANK YOU SO MUCH!!!!

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

    thank you verymuch a lot

  • @naksushi8228
    @naksushi8228 2 года назад +9

    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.

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

      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

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

    Great video, thanks!

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

      Glad you enjoyed @Zach Smith!

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

    Yes! Thanks so much! I always try other tutorials but the animation never works for me. This video really helped me! Thank you!

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

      Glad you enjoyed @HeroicAgenda576!

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

      MY NAME MRRRR CHHHEEEEEEEEEEEEEEEEESE

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

    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!

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

    what is the editor you used?

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

    New subscriber

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

    i keep getting "expected an identifier and instead saw const" on the javascript page. any tips on that?

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

    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;

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

    I have to make my webpage where the game is, long it takes up most of my screen space. Any ideas?

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

    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

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

    loved the video. really helped me honestly.

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

      Thank you for the feedback @Mirale

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

    can u do a video where u make this game more advanced and interesting?

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

    Nice very nice

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

      Glad you enjoyed @Sertan Sahbaz

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

    Cant we do overflow hidden to hide rock if it gets out of the div?

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

      I tried it and worked also

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

    I just did every thing and my dino still not jump can you help me ?

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

    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

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

      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

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

    What code editor are you using?

  • @SmartT-gamer5
    @SmartT-gamer5 2 года назад

    My dinosaur image isn't showing up, can you explain why?

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

    keeps underlining my colons do anyone know why pls help its not working

  • @parindyapigera1790
    @parindyapigera1790 2 месяца назад

    Why is that the Dinosaur's legs aren't moving?

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

    How did you align the score. Your screen is covering the code and your accent is hard to understand

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

    my dinasour dosent jump

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

    Thank you, You are awesome but you need to get your voice a little bit higher...

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

    dinosaur is not jumping

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

    MY NAME MR CHEESE!!!

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

    voice is too low

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

      Thank you for the feedback, will try to make it better next time

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

      MRY NRAME MRE CHREsSE