How to Make Minesweeper In Godot | Beginner Tutorial

Поделиться
HTML-код
  • Опубликовано: 14 окт 2023
  • Learn the basics of Godot by making a mine sweeper clone in this tutorial.
    The code for the game is built from scratch and will re-create all the features of minesweeper. This will use tilemaps with various layers for the mines, numbers, grass and flag tiles. Recursion will also be used to reveal some of the tiles.
    Code and assets for this video: github.com/russs123/minesweep...

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

  • @NagaGaming76
    @NagaGaming76 Месяц назад

    Thank you soo much for making this! I've always wanting to do a more "challenging" project to start out with but all other tutorials were all outdated. Not only was this tutorial very insightful, it also provided a smooth lesson into each of godot's mechanics. Good job!

  • @kshawn2579
    @kshawn2579 7 месяцев назад +1

    Thanks Russ! You are so underrated. From Pygame to Ursina to Godot. What a Legend!

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

    Thanks again! Learned something new from this tutorial.

  • @uh7123zz1azxcv
    @uh7123zz1azxcv 7 месяцев назад +1

    Thanks! Glad you're returning to the code along style
    I know it's much more demanding in terms of time and effort, much appreciated Russ
    Thanks again for the nice tutorial

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

    Awesome tutorial to learn how to use arrays

  • @thehogman.
    @thehogman. 7 месяцев назад +3

    Thanks for all the tutorials. If I could, I'd recommend solitaire next. Thanks again!

    • @CodingWithRuss
      @CodingWithRuss  7 месяцев назад +3

      For some reason I hadn't considered card games, that could be an interesting one to work on!

  • @qingxian3870
    @qingxian3870 Месяц назад

    thank you bro, im learning alot from this video.
    I followed the video step by step and finished it !
    And i actually learned a lot ,now i know how to use array and loop
    And i think we no need a move_mine() function.
    If first click is not empty cell, we can while a new_game() function until a cell is empty 🤔

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

    50:17 the flood fill algorithm. Get adjicent cells that meets a condition

  • @danirookie
    @danirookie Месяц назад

    Learning a lot with this tutorial. Short doubt: is there any Tilemap method that returns what item from your tileset you're clicking on? ie: a function that returns the original tileset position that corresponds to a given tile you click on. I'm just trying with get_cell_tile_data(number_layer, map_pos) to get the Number i'm clicking on but no success so far. Many thanks!

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

    can u make playlist for the basic pygame functions pls, it will help me learn alot better

  • @SEOmaster_real
    @SEOmaster_real 7 месяцев назад +1

    cool< want more video!

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

    hey russ, my pygame window suddenly started to take a while to load, do you know what might be the cause?

  • @rezashir3873
    @rezashir3873 7 месяцев назад +1

    you are amazing🙃😊

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

    If mines and numbers are never placed on top of each other couldn't we put them in the same layer?

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

    I hope you make a game match 3

  • @dovos8572
    @dovos8572 22 дня назад

    at 17:30 you are using 2 for loops to iterate over the tilemap to search for the mines. why aren't you just using the mines array that you created before in the mines layer? that would mean you only need one for loop and a simple check if it is at the border.
    then just add +1 around the mine cell. after each mine cell is looped through the surrounding cells should be set correctly.
    to do the +1 you just need to add +1 to the atlas x coordinate.
    this should simplify that part of the code quite a bit.
    also i don't know if you change that later in the video, so this comment might not be as relevant.
    now at 25:50 i'm really confused what you are doing. it seems that you are doing the inverse of what i thought should be done with the first part of my comment. why are you searching the 8 cells around an empty cell and hope that a bomb is in it? using that exact function on the bomb would give you all cells that need to increment it's shown number. you don't need to go through all empty cells of the tilemap and count the surrounding bombs that COULD be there.

    • @dovos8572
      @dovos8572 22 дня назад

      for those interested, this is what i thought it would be.
      @export var Columns : int = 16
      @export var Rows : int = 16
      @export var MineCount : int = 10
      @export var Mine_positions : Array[Vector2i]
      enum Layers {Background, Mines, Numbers, Gras, Pointer}
      func create_mines():
      var mine_texture = Vector2i(5,1)
      for i in range(MineCount):
      var mine_pos : Vector2i = Vector2i(randi_range(0, Columns-1), randi_range(0, Rows-1))
      while Mine_positions.has(mine_pos):
      mine_pos = Vector2i(randi_range(0, Columns-1), randi_range(0, Rows-1))
      Mine_positions.append(mine_pos)
      set_cell(Layers.Mines, mine_pos, 0, mine_texture)
      func create_numbers():
      var target_cell : Vector2i
      for mine_pos in Mine_positions:
      for x in range(3):
      for y in range(3):
      target_cell = mine_pos + Vector2i(x - 1, y - 1)
      if target_cell != mine_pos and !Mine_positions.has(target_cell) :
      if (target_cell.x >= 0 and target_cell.x = 0 and target_cell.y

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

    i paused at 48:18 and accidentally completed a minesweeper lol

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

    what language do you use in godot?

    • @CodingWithRuss
      @CodingWithRuss  7 месяцев назад +3

      It's GD Script, Godot's own language. It's very similar to python

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

      and js@@CodingWithRuss

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

      ​​​@@CodingWithRussI'm learning python but Pygame is quite limited, if I learn python and then switch to Godot would it be possible to use Python the way it's used on Pygame, the same way in Godot?

    • @CodingWithRuss
      @CodingWithRuss  6 месяцев назад +1

      @@muslimsinhistory Godot uses its own language GDScript but it is very similar to python so switching from pygame to godot will be easier if you are already learning python. There will still be a lot to learn in the godot engine itself as it is quite different to using pygame

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

      Should I keep learning python or just switch to Godot straight away?@@CodingWithRuss