Create A Snake Game in HTML CSS & JavaScript | JavaScript Game Tutorial

Поделиться
HTML-код
  • Опубликовано: 19 май 2024
  • In this video, I've shown how to Create A Snake Game using HTML, CSS, and JavaScript. This game is designed to be played both on a PC using keyboard arrow keys and on a mobile device using touch-based arrow buttons.
    Live Demo or Download Code of this Snake Game
    codingnepalweb.com/demos/snak...
    Follow me on Instagram
    / coding.np
    Timestamps:
    0:00 Demo of Snake Game
    2:24 HTML & CSS Start
    5:46 JavaScript Start
    06:09 Creating Snake Food & Head
    10:41 Moving Snake on Arrow Key Click
    15:20 Adding Snake Body Part After Eating Food
    19:18 Showing Game Over Alert When Snake Collides with Wall
    23:20 Showing Game Over Alert When Snake Hit the Body
    24:40 Updating Current Score
    26:00 Updating High Score
    28: 50 Creating Arrows Button for Touch Devices
    30:33 Moving Snake on Arrow Button Click
    #javascript #html #css #javascriptprojects #js #javascriptgame
    Music Credit:
    Ikson - We Are Free [Official]
    • #83 We Are Free (Offic...
    Deep Sea by Vendredi
    • Deep Sea - Vendredi (N...
    Miss You - LiQWYD
    • Miss You - LiQWYD (No ...

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

  • @CodingNepal
    @CodingNepal  Год назад +14

    Play this Snake Game: codingnepalweb.com/demos/snake-game-javascript/

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

      source code?

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

      Here is the source code: www.codingnepalweb.com/create-snake-game-htm-css-javascript/

    • @user-qj4qu7bb2i
      @user-qj4qu7bb2i Год назад

      Do u have Architecture diagram and module for this project

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

    absolutely loved it. amazing work. you rock man.

  • @devsilva7155
    @devsilva7155 Год назад +8

    18:05 you can create a memory game, where when you reach a control point, which is the light blue dot, the screen will be filled with more light blue dots, the idea is to fill as many dots as possible, if you touch a dot that you already touched, you lose, if you touch the wall, you lose. and you just have to rely on what is in that minute.

  • @namjotsingh
    @namjotsingh Год назад +2

    Amazing project. Very informative and I got to learn a lot about JavaScript and using logic. Thanks for such videos.

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

    Thank you.. You explained it clearly

  • @Stardippedd
    @Stardippedd 7 месяцев назад

    thank you i had fun creating this and I learned a lot!

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

    스네이크 바이트 게임..
    Whoo, what a trip down memory lane, huh?

  • @zillalsenmesrane1022
    @zillalsenmesrane1022 Год назад +5

    i love the way ur using logic .. thank you for your efforts bro

  • @davidconteh2231
    @davidconteh2231 Год назад +2

    This channel is going to be great. Thank for creating awesome contents.

  • @LuisMedina-dk3vc
    @LuisMedina-dk3vc Месяц назад

    Amazing. Thank you so much.

  • @nosibahassan8971
    @nosibahassan8971 10 месяцев назад +1

    Thank you very much 😍🥰

  • @AriqTech
    @AriqTech Год назад +15

    Can you create a chess game using HTML, CSS & JS?
    Function you may include:
    -User can select white side /Black black/Random
    -Can include 3 levels: Easy, Medium & Hard.
    Thanks!

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

    Brillint thing sir

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

    Most waited video ✨❤️

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

    Very good! 👏🏻👏🏻👏🏻👏🏻💚

  • @gamingshorts2809
    @gamingshorts2809 8 месяцев назад

    Can you add difficulty levels please or can you tell me how to add it

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

    It was great, I was excited😄🙂😊

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

    amazing...

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

    😂 love this video.

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

    Awesome

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

    Mindblowing

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

    U r the best🥰

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

    Your all videos love it 💕.
    Dear can you upload complete HTML, CSS , JavaScript and PHP course with voice Urdu or Hindi . Like frontend and backend development full course.
    Bz I'm very excited for this course

  • @S-Lomar
    @S-Lomar 8 месяцев назад +1

    Well done 🥰🥰🥰🥰🥰🥰🥰🥰😍😍😍😍😍😍😍😍😍😍😍😍😍

  • @S-Lomar
    @S-Lomar 8 месяцев назад +1

    Well done

    • @S-Lomar
      @S-Lomar 8 месяцев назад

      🤯🤯🥰🥰🥰🥰🥰🥰🤯🤯🤯🤯🥰🥰🥰🥰🥰put in play store

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

    Best video, by the way voice ni rakhnu na !!

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

    lo ví en español.esta bueno la forma que lo hace con grid

  • @social.knowledge_0
    @social.knowledge_0 Год назад

    Thank you

  • @Jay-eg9mv
    @Jay-eg9mv 10 месяцев назад

    Can anyone explain how the snake length expansion is working?

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

    Good

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

    Teach me how to make a thermometer

  • @S-Lomar
    @S-Lomar 8 месяцев назад +3

    You guys 're showing only how to create games what 'bout publishe in play store and start earning?????? Please please please please please guys 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

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

    Hey, how do you see the result on browser on vsc?

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

    شكرًا

    • @CodingNepal
      @CodingNepal  Год назад +2

      Thank you for your support

    • @gameshort_s
      @gameshort_s Год назад +2

      @@CodingNepal It's a little something for your effort🥰
      Can you make more backend projects with php and mysql 🌹

  • @pooja3339
    @pooja3339 Месяц назад +1

    How to make snake eyes ??

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

    Can you explain pls what is foodX/Y end why did you deleted its value

    • @gandhibarra3036
      @gandhibarra3036 8 месяцев назад

      FoodX/Y is the position of where the food is going to be. He deleted the values because he wanted to make the food position as random{(Math.random() * 30) + 1}and not as a fixed position on the grid.

    • @asmet2701
      @asmet2701 8 месяцев назад

      @@gandhibarra3036 thanks I even forgot about this project

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

    Bro added you're sounds

  • @debabratagon7289
    @debabratagon7289 4 месяца назад

    What if the food appears in the body of snake?

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

    Thanks for the work done
    But your website cannot be reached please fix this. Thank you so much

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

      Can you check now: www.codingnepalweb.com/

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

      @@CodingNepal not yet working probably you should always use Google drive for the source too but please fix the website

  • @cringmingtech
    @cringmingtech 9 месяцев назад

    changeFoodPosition is not working....help plzz

  • @sojibhasan4759
    @sojibhasan4759 9 месяцев назад

    Someone please explain the body segment
    for(i =snakebody.lenght-1,i > 0,
    i--){ snakebody[i]=snakebody[i-1]}

    • @baazigar5
      @baazigar5 9 месяцев назад

      It was really hard to understand for me too but after trying very hard i understood.
      Suppose we have an array with 3 items, so by this for loop, 3rd item's value will be equal to 2nd item then 2nd item's value will be equal to 1st item and then after coming out of for loop, the value of 1st item will increase by one with velocity variable... I hope you understood 😅

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

    Please start a react js projcet

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

      👎 I don’t see the benefits of using react js

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

      Yes

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

      @@TheLoona better for getting a job

  • @nguyentienkha2908
    @nguyentienkha2908 9 месяцев назад

    I dont know the meaning of this line : ${snakeBody[i][1]}/${snakeBody[i][0]

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

    no using: ' ' or " ".
    using: ` ` in Java Script!

  • @nakulmittal9953
    @nakulmittal9953 7 месяцев назад

    18:00

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

    SOURCECODE PLEASE

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

      in the description

    • @CodingNepal
      @CodingNepal  Год назад +2

      Here is the source code: www.codingnepalweb.com/create-snake-game-htm-css-javascript/

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

      @@CodingNepal Please make a video in realtime chat app with firebase in private mode with pure javascript

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

      @@CodingNepal Thankyo so much I'm glad to here with your source really good vibe to do with this

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

    I don't success for this project

  • @S-Lomar
    @S-Lomar 7 месяцев назад

    💕💕💕💕💕💕💕💕💕💕💕💕💕💕💕💕💕💕💓💕💕💓💓