Code Pacman in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 24

  • @KennyYipCoding
    @KennyYipCoding  25 วันที่ผ่านมา

    //X = wall, O = skip, P = pac man, ' ' = food
    //Ghosts: b = blue, o = orange, p = pink, r = red
    private String[] tileMap = {
    "XXXXXXXXXXXXXXXXXXX",
    "X X X",
    "X XX XXX X XXX XX X",
    "X X",
    "X XX X XXXXX X XX X",
    "X X X X",
    "XXXX XXXX XXXX XXXX",
    "OOOX X X XOOO",
    "XXXX X XXrXX X XXXX",
    "O bpo O",
    "XXXX X XXXXX X XXXX",
    "OOOX X X XOOO",
    "XXXX X XXXXX X XXXX",
    "X X X",
    "X XX XXX X XXX XX X",
    "X X P X X",
    "XX X X XXXXX X X XX",
    "X X X X X",
    "X XXXXXX X XXXXXX X",
    "X X",
    "XXXXXXXXXXXXXXXXXXX"
    };
    Completed code with sprites:
    github.com/ImKennyYip/pacman-java

  • @MarkE-mp9li
    @MarkE-mp9li 3 วันที่ผ่านมา

    This channel is amazing! I've just started learning Java and your channel has been really helpful

  • @neverexperience
    @neverexperience หลายเดือนก่อน +2

    Fantastic video man, just coded along with the video. The walkthrough was very smooth and great explanation. Loved it
    I'm thinking to add an 8 bit audio, powerups etc, it was real fun

  • @HarisKhan-i7b8s
    @HarisKhan-i7b8s 8 ชั่วโมงที่ผ่านมา

    kenny, is any datastructure used in that project???

  • @CaioSantos_p15
    @CaioSantos_p15 หลายเดือนก่อน +3

    You're the goat man! I love all your videos!

  • @lokaam3092
    @lokaam3092 25 วันที่ผ่านมา +1

    hi! great tutorial that was very efficient thank you so much!
    ps: at 20:45 you said you would put the map code in the video description and i think you forgot ;)

    • @KennyYipCoding
      @KennyYipCoding  25 วันที่ผ่านมา

      ahh yes I did forget!, Added the map code in pin comment

  • @johnmichaelocado5261
    @johnmichaelocado5261 17 วันที่ผ่านมา

    Can i ask what are the sizes of the pictures that you used on this game?

  • @stefangrigore8878
    @stefangrigore8878 หลายเดือนก่อน +3

    bro, your work is amazing, but can you please help me with something? everytime i save my project some lines in the code gets deleted and i dont know why. Ill apreciate it if you can help me

    • @KennyYipCoding
      @KennyYipCoding  หลายเดือนก่อน

      That doesn’t happen to be so I have no idea why that is the case either, are you using vscode with Java? What lines are being deleted? Empty white space lines?

    • @stefangrigore8878
      @stefangrigore8878 หลายเดือนก่อน

      @@KennyYipCoding yes, i am using vscode with java. im a begginer and im trying to learn. These 3
      import java.awt.event.*;
      import java.util.HashSet;
      import java.util.Random;
      No matter what i do they always get deleted

    • @KennyYipCoding
      @KennyYipCoding  หลายเดือนก่อน +2

      There’s probably some extension installed or built in setting that gets rid of unused imports. If you add import statements and save, technically you still haven’t used the imports so the code automatically gets deleted. Should be an easy fix if you google/stack overflow “vscode unused imports being deleted”

    • @stefangrigore8878
      @stefangrigore8878 หลายเดือนก่อน

      @@KennyYipCoding thanks for the help i managed to fix it

  • @excujeeme997
    @excujeeme997 หลายเดือนก่อน

    Hey can you tell me which platform you are using for coding?

    • @KennyYipCoding
      @KennyYipCoding  หลายเดือนก่อน

      Vscode, there is a video link guide in my video description explaining how to setup Java with vscode

  • @SajithaUdesh
    @SajithaUdesh 8 วันที่ผ่านมา

    Can you tell me the name of the app you used here?

    • @KennyYipCoding
      @KennyYipCoding  8 วันที่ผ่านมา

      You mean the code editor? It’s called vscode, as mentioned in the video.

  • @n4nalife
    @n4nalife หลายเดือนก่อน

    Thanks for your videos! They are amazing :)

  • @lila7410
    @lila7410 17 วันที่ผ่านมา

    9:00 Why did u add private to all of them?

    • @ugniusmamaniskis502
      @ugniusmamaniskis502 15 วันที่ผ่านมา

      thats so noone could cahnge the values

  • @robtai6225
    @robtai6225 หลายเดือนก่อน

    awesome thank you so much!!!

  • @adityamukherjee2207
    @adityamukherjee2207 หลายเดือนก่อน +1

    bro while trying to run the code after 27:40 , the following error is showing :
    exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null
    at java.desktop/javax.swing.ImageIcon.(ImageIcon.java:232)
    at Pacman/pacman.Pacman.(Pacman.java:88)
    at Pacman/pacman.App.main(App.java:22)
    i have tried changing the path if the images , but still not working . i am using eclipse ide. can u help me further in this plz ....

    • @ugniusmamaniskis502
      @ugniusmamaniskis502 15 วันที่ผ่านมา

      ask chatGPT

    • @167-naureen3
      @167-naureen3 3 วันที่ผ่านมา

      Same error is showing on my code too if you have found how to solve that plz tell me🥲