1 hour Pac-man in JavaScript!

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • Found this hard? Learn the fundamentals of JavaScript here: www.codewithan...
    🚀 Sign up to www.codewithan... 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, 1, 1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 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_webs...
    ⭐ New to code and none of this is making sense? Watch my '12hr+ CZcams 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-...
    ⭐ You can get a blockchain domain with my affiliate link here: bit.ly/get-a-cr...
    ⭐ If you would like to buy me a coffee, well thank you very much that is mega kind! : www.buymeacoff...
    ⭐ 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

Komentáře • 42

  • @RAVISHARMA-hk5ll
    @RAVISHARMA-hk5ll Před 6 měsíci +9

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

  • @arkansavalder
    @arkansavalder Před měsícem +3

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

  • @miketam9017
    @miketam9017 Před 6 měsíci +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  Před 6 měsíci +1

      That's awesome! Would love to see!

  • @tonyross2947
    @tonyross2947 Před 6 měsíci +3

    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!

  • @sagarbharati1438
    @sagarbharati1438 Před 6 měsíci +1

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

  • @Webdevlook
    @Webdevlook Před měsícem

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

  • @patekreol974
    @patekreol974 Před 6 měsíci

    Le code informatique est une œuvre d'art !

  • @lance3401
    @lance3401 Před 6 měsíci

    Thanks Ania for the tutorial, practice make us masters!

  • @alexeykagansky9927
    @alexeykagansky9927 Před 6 měsíci +3

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

  • @sekretyit
    @sekretyit Před 6 měsíci +1

    can't wait

  • @Me-sz7yy
    @Me-sz7yy Před 6 měsíci

    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 🥰

  • @RyuBateson218
    @RyuBateson218 Před 6 měsíci

    Thanks Ania!

  • @ruslangilyazov7733
    @ruslangilyazov7733 Před 6 měsíci

    Thank you for the fantastic lesson!

  • @Researcher9868
    @Researcher9868 Před 5 měsíci

    And finished. Thanks!

  • @TheMetalMag
    @TheMetalMag Před 6 měsíci +1

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

  • @OliverOlsen-pb3zo
    @OliverOlsen-pb3zo Před 3 měsíci +1

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

    • @aniakubow
      @aniakubow  Před 3 měsíci

      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 Před 3 měsíci

      @@aniakubowDo i have to pay?

  • @user-ov1ps7go4m
    @user-ov1ps7go4m Před 6 měsíci +1

    What happened to the JS Zelda game tutorial?

  • @amankudaibergen7079
    @amankudaibergen7079 Před 6 měsíci +1

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

  • @Peterplayingguitar
    @Peterplayingguitar Před 5 měsíci

    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 Před 4 měsíci

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

  • @ronnydon15
    @ronnydon15 Před 6 měsíci +1

    Make a dominoes game

  • @neerajkumarkondabattula
    @neerajkumarkondabattula Před 6 měsíci

    Awesome 👌

  • @aquilkudai2466
    @aquilkudai2466 Před 6 měsíci +1

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

    • @aquilkudai2466
      @aquilkudai2466 Před 6 měsíci

      There is no sign up option on the website

  • @devoiddude
    @devoiddude Před 6 měsíci

    28:39

  • @sergiocontrerasgraide1734
    @sergiocontrerasgraide1734 Před 5 měsíci

    Gracias

  • @SpiderYass
    @SpiderYass Před 6 měsíci

    Thanks you deserve a sub❤

  • @patekreol974
    @patekreol974 Před 6 měsíci

    Super

  • @daredaron3843
    @daredaron3843 Před 6 měsíci

    You can fix me ❤

  • @codewithabuki
    @codewithabuki Před 6 měsíci

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

  • @user-mh1km3mv7z
    @user-mh1km3mv7z Před 6 měsíci +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  Před 6 měsíci

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

    • @spacedoutpanda4670
      @spacedoutpanda4670 Před 6 měsíci +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  Před 6 měsíci +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, 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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 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 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
      ]

  • @user-mm6yf5yb4b
    @user-mm6yf5yb4b Před 6 měsíci

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