Code Minesweeper in Java

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • How to code a Minesweeper game in Java for beginners! Learn how to create a game of Minesweeper in Java using the awt and swing graphics library.
    In this tutorial, you will learn how to make the classic game, minesweeper! You will learn how to create a graphical user interface (GUI) to display 8x8 grid of tiles. You will also learn to add click handlers to select a tile. With a left click, you will learn to open a tile, detect if the tile contains a mine, count the number of mines surround the tile, and recursively check neighboring tiles to count the number of mines surround those tiles. With a right click, you will learn to place and remove flags on a tile. After understanding the core game logic, you will learn how to generate levels by placing mines in random tiles.
    Setup Java with Visual Studio Code:
    • How to set up Java in ...
    Mine: 💣
    Flag: 🚩
    Code: github.com/ImK...
    Website: www.kennyyipco...
    Java Game Programming Projects Playlist:
    • Java Game Programming ...
    JavaScript Game Programming Projects Playlist:
    • JavaScript Game Progra...
    Subscribe for more coding tutorials 😄!

КОМЕНТАРІ • 15

  • @kratosAk4700
    @kratosAk4700 7 місяців тому +2

    Mannn..... These tutorials are gold mines.... Keep working bro

  • @MysticGabry
    @MysticGabry 7 місяців тому +2

    dont we should generate the map after the first touch? To avoid the possibilty of starting pressing a bomb

  • @goodnessuche1430
    @goodnessuche1430 Рік тому

    Beautiful. Just a learner. But can you do a tutorial for a scrabble game

  • @coolrexchannel
    @coolrexchannel 10 днів тому

    Nice video!!

  • @mateussebastian
    @mateussebastian 10 місяців тому

    So nice!

  • @krutikavairal5380
    @krutikavairal5380 Рік тому +3

    can we do this project on eclipse?

  • @JeriSmiler
    @JeriSmiler 10 місяців тому +1

    How do I make it where the first click does not have a chance to be a mine? I'm creating this project for the ITF class I take, and I want to make it so that anyone who wants to try it out doesn't get blown up on the first click. (Thank you for making this tutorial by the way, it is SUPER helpful!)

    • @KennyYipCoding
      @KennyYipCoding  10 місяців тому +3

      You can make a check to see if it’s the first click and if so, check if that tile has a mine. If it has a mine, swap it with another tile and regenerate the board, then process the tile click! Good luck!

  • @gustavoreyes9237
    @gustavoreyes9237 10 місяців тому

    THANK YOU SO MUCH!!! I am coding in python trying to recreate minesweeper using a library called graphics but this still helped me out!!

  • @trumooisalime2543
    @trumooisalime2543 5 місяців тому

    every time i try to run it the minesweeper game doesn’t pop up on my computer screen what could this be?

  • @kasididyookong1569
    @kasididyookong1569 11 місяців тому

    kiss kiss

  • @JohnStephen-j5j
    @JohnStephen-j5j 4 місяці тому

    Sorry sir how can i get code of snake game

    • @KennyYipCoding
      @KennyYipCoding  4 місяці тому

      It’s in the video description GitHub link

  • @karthikm.1804
    @karthikm.1804 Рік тому +1

    Pathfinder visualizer in javascript