1 hour Pac-man in JavaScript!

Поделиться
HTML-код
  • Опубликовано: 20 фев 2024
  • Found this hard? Learn the fundamentals of JavaScript here: www.codewithania.com
    🚀 Sign up to www.codewithania.com to receive access for the final code.
    const layout = [
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
    1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
    1, 3, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 3, 1,
    1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
    1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
    1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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, 0, 1, 1, 0, 1, 1, 1,
    1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    ]
    ____
    ⭐ Check out my IDE here and get 1 month free: jb.gg/get_webstorm
    ⭐ New to code and none of this is making sense? Watch my '12hr+ RUclips Coding Bootcamp' in which you will learn HTML, CSS and JavaScript Fundamentals completely from scratch. It's on my channel and its 100% free.
    ⭐ In most videos I use Tabnine as my A.I autocompletion tool. You can download it for free here (I get no commission from this link, but am in a partnership): bit.ly/tabnine-top-tool
    ⭐ You can get a blockchain domain with my affiliate link here: bit.ly/get-a-crypto-domain
    ⭐ If you would like to buy me a coffee, well thank you very much that is mega kind! : www.buymeacoffee.com/aniakubow
    ⭐ Sign up for weekly coding tips from my newsletter partnership: bit.ly/JS-tips
    You can also find me on:
    Twitter: / ania_kubow
    Instagram: / aniakubow
  • РазвлеченияРазвлечения

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

  • @RAVISHARMA-hk5ll
    @RAVISHARMA-hk5ll 5 месяцев назад +8

    May God Bless you Ania, this is very useful learning for me - thanks

  • @LeeCatherine-e5d
    @LeeCatherine-e5d Месяц назад

    Thank you for this awesome video! Have a blessed day Ania

  • @lance3401
    @lance3401 5 месяцев назад

    Thanks Ania for the tutorial, practice make us masters!

  • @RyuBateson218
    @RyuBateson218 5 месяцев назад

    Thanks Ania!

  • @sagarbharati1438
    @sagarbharati1438 5 месяцев назад +1

    Thank you for the fantastic videos! Could you consider creating a React Native course, covering basics to advanced topics, available on RUclips or as a paid option? It would greatly benefit beginners like me eager to learn. Thanks for your dedication!

  • @miketam9017
    @miketam9017 5 месяцев назад +2

    I followed along and made a few improvements such as small icons/images for pacman and ghosts, different color scheme, scoreboard, and even music. Next wil try is joystick support. Thank you for tutorial 😊

    • @aniakubow
      @aniakubow  5 месяцев назад +1

      That's awesome! Would love to see!

  • @patekreol974
    @patekreol974 5 месяцев назад

    Le code informatique est une œuvre d'art !

  • @sekretyit
    @sekretyit 5 месяцев назад +1

    can't wait

  • @Me-sz7yy
    @Me-sz7yy 5 месяцев назад

    Hi Ania I love your videos, I'm such a fan, thanks for spending the time doing what you do, good vibes to you, 😀😃, I Love you 🥰

  • @neerajkumarkondabattula
    @neerajkumarkondabattula 5 месяцев назад

    Awesome 👌

  • @alexeykagansky9927
    @alexeykagansky9927 5 месяцев назад +3

    Спасибо за классный урок❤

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

    And finished. Thanks!

  • @tonyross2947
    @tonyross2947 5 месяцев назад +2

    Amazing. Things for devs watching this to "sort" or work on. The ghosts were vanishing on the pac-dots (they were just changing the pac-dots to their own colour) and also, Pac Man doesn't need a press of keys all the time; a right arrow should make Pac-man move right until he encounters a wall or other obstacle. But like I saw; awesome work. I'll be playing with this one!

  • @SpiderYass
    @SpiderYass 5 месяцев назад

    Thanks you deserve a sub❤

  • @ruslangilyazov7733
    @ruslangilyazov7733 5 месяцев назад

    Thank you for the fantastic lesson!

    • @aniakubow
      @aniakubow  5 месяцев назад

      Glad you liked it!

  • @amankudaibergen7079
    @amankudaibergen7079 5 месяцев назад +1

    Where is the code to copy? I could not find.

  • @arkansavalder
    @arkansavalder 28 дней назад +2

    Please don't overwhelm me with your code, your beauty is already astonishing!

  • @TheMetalMag
    @TheMetalMag 5 месяцев назад +1

    although u did it long time ago I'm still up to to practice js

  • @patekreol974
    @patekreol974 5 месяцев назад

    Super

  • @user-ov1ps7go4m
    @user-ov1ps7go4m 5 месяцев назад +1

    What happened to the JS Zelda game tutorial?

  • @sergiocontrerasgraide1734
    @sergiocontrerasgraide1734 5 месяцев назад

    Gracias

  • @Peterplayingguitar
    @Peterplayingguitar 5 месяцев назад

    Great video! Thanks for posting. Some constructive criticism : your predictive text can really be confusing and throw the viewer off course a bit, especially when you are explaining things and the predictive code on screen is displayed and showing something different. A minor nitpick but thanks for the great tutorial.

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

    Wow a great video, proofs much can be achieved by Javascript...please can you make a working e-commerce website video too🥺

  • @aquilkudai2466
    @aquilkudai2466 5 месяцев назад +1

    i am having difficulty in accessing source code , Can anyone access it or is it reserved for members only?

    • @aquilkudai2466
      @aquilkudai2466 5 месяцев назад

      There is no sign up option on the website

  • @ronnydon15
    @ronnydon15 5 месяцев назад +1

    Make a dominoes game

  • @daredaron3843
    @daredaron3843 5 месяцев назад

    You can fix me ❤

  • @OliverOlsen-pb3zo
    @OliverOlsen-pb3zo 3 месяца назад +1

    The code doesn't work properly. Is the code published on github or something? So i can copy it

    • @aniakubow
      @aniakubow  3 месяца назад

      Sorry you are having trouble with your code. If you follow along with the video you will see the code works as we play the game :). If you are still having trouble you can join codewithania.com to get the final code

    • @OliverOlsen-pb3zo
      @OliverOlsen-pb3zo 2 месяца назад

      @@aniakubowDo i have to pay?

  • @devoiddude
    @devoiddude 5 месяцев назад

    28:39

  • @codewithabuki
    @codewithabuki 5 месяцев назад

    I wait you 🎉 always don't forget for simple talking

  • @user-mm6yf5yb4b
    @user-mm6yf5yb4b 5 месяцев назад

    A sweet and beautiful girl.It's a pity that I don't have one.

  • @user-mh1km3mv7z
    @user-mh1km3mv7z 5 месяцев назад +1

    ugh - share the layout array who wants to waste their time figuring that out?
    you said the codes available ... once you pay for your website, lol! no thanks :/

    • @aniakubow
      @aniakubow  5 месяцев назад

      You can copy the code from the video for free :)

    • @spacedoutpanda4670
      @spacedoutpanda4670 5 месяцев назад +1

      Hey @@aniakubow I think the person here is saying they can't locate the array layout in the video description. I am experiencing the same. Nothing about it is posted in the video description as I was trying to follow along as well and got stuck here. Not a huge pain point but it did cause me to not want to continue with the tutorial immediately and put it off for later. Just wanted to clarify as I'm sure you didn't intentionally mean to create extra unnecessary hurdles for your viewers. Excited for the description update. I appreciate you

    • @aniakubow
      @aniakubow  5 месяцев назад +1

      Ah @@spacedoutpanda4670 . Does this help?
      const layout = [
      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
      1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
      1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
      1, 3, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 3, 1,
      1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
      1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
      1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
      1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
      1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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